Skip to content

Commit 56aaa59

Browse files
authored
Merge pull request #707 from TeamREPENTOGON/hitlist
EntityTear GetHitList & ClearHitList
2 parents 851c1c8 + 1513831 commit 56aaa59

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

libzhl/functions/EntityTear.zhl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ struct Entity_Tear depends (ANM2, BitSet128, Vector) : public Entity {
6868
BitSet128 _tearFlags : 0x428;
6969
int _waitFrames : 0x438;
7070
Vector _continueVelocity : 0x43c;
71+
std_vector_uint _hitList : 0x444;
7172
int _tearIdx : 0x450;
7273
float _baseDamage : 0x454;
7374
float _rotation : 0x458;

repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,28 @@ LUA_FUNCTION(Lua_SetPrismTouched) {
7171
return 0;
7272
}
7373

74+
LUA_FUNCTION(Lua_GetHitList) {
75+
Entity_Tear* tear = lua::GetLuabridgeUserdata<Entity_Tear*>(L, 1, lua::Metatables::ENTITY_TEAR, "EntityTear");
76+
77+
lua_newtable(L);
78+
int idx = 1;
79+
for (int index : tear->_hitList) {
80+
lua_pushnumber(L, idx);
81+
lua_pushinteger(L, index);
82+
lua_settable(L, -3);
83+
idx++;
84+
}
85+
86+
return 1;
87+
}
88+
89+
LUA_FUNCTION(Lua_ClearHitList) {
90+
Entity_Tear* tear = lua::GetLuabridgeUserdata<Entity_Tear*>(L, 1, lua::Metatables::ENTITY_TEAR, "EntityTear");
91+
tear->_hitList.clear();
92+
93+
return 0;
94+
}
95+
7496
HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
7597
super();
7698

@@ -87,6 +109,8 @@ HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
87109
{ "SetMultidimensionalTouched", Lua_SetMultidimensionalTouched },
88110
{ "IsPrismTouched", Lua_IsPrismTouched },
89111
{ "SetPrismTouched", Lua_SetPrismTouched },
112+
{ "GetHitList", Lua_GetHitList },
113+
{ "ClearHitList", Lua_ClearHitList },
90114
{ "FireSplitTear", SplitTears::Lua_FireSplitTear },
91115
{ NULL, NULL }
92116
};

0 commit comments

Comments
 (0)