Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto main
  • Loading branch information
ConnorForan committed Jul 14, 2024
2 parents 3788504 + 01e4f88 commit ff75d0f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Additions:
- ClearFlyingOverride() - Removes any value set by SetFlyingOverride.
* EntityLaser:
- RecalculateSamplesNextUpdate() - Requests the laser's shape to be fully recalculated next time it updates. Can be used to force the laser to instantly change its MaxDistance/Radius instead of transitioning to it. No effect for OneHit or non-sample lasers.
* EntityPickup:
- TriggerTheresOptionsPickup() - Removes pickups with the same option group (OptionsPickupIndex) as the target pickup.
/newline/
v1.0.10c -
Additions:
Expand Down
2 changes: 2 additions & 0 deletions libzhl/functions/EntityPickup.zhl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ __thiscall LootList Entity_Pickup::GetLootList(bool ShouldAdvance);
"558bec6aff68????????64a1????????5083ec185657a1????????33c5508d45??64a3????????8bf1":
__thiscall void Entity_Pickup::UpdatePickupGhosts();

"558bec6aff68????????64a1????????5083ec24535657a1????????33c5508d45??64a3????????8bd98b83":
__thiscall void Entity_Pickup::TriggerTheresOptionsPickup();

"83f93274??83f93c":
static cleanup bool Entity_Pickup::IsChest(uint32_t variant<ecx>);
Expand Down
8 changes: 8 additions & 0 deletions repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ LUA_FUNCTION(Lua_PickupUpdatePickupGhosts) {
pickup->UpdatePickupGhosts();
return 0;
}

/*LUA_FUNCTION(Lua_PickupIsChest) {
Entity_Pickup* pickup = lua::GetUserdata<Entity_Pickup*>(L, 1, lua::Metatables::ENTITY_PICKUP, "EntityPickup");
unsigned int variant = (unsigned int)luaL_optinteger(L, 2, pickup->_variant);
Expand All @@ -207,6 +208,12 @@ LUA_FUNCTION(Lua_PickupUpdatePickupGhosts) {
*/


LUA_FUNCTION(Lua_PickupTriggerTheresOptionsPickup) {
Entity_Pickup* pickup = lua::GetUserdata<Entity_Pickup*>(L, 1, lua::Metatables::ENTITY_PICKUP, "EntityPickup");
pickup->TriggerTheresOptionsPickup();
return 0;
}

HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
super();

Expand Down Expand Up @@ -236,6 +243,7 @@ HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
//{ "IsChest", Lua_PickupIsChest },
{ "GetPickupGhost", Lua_PickupGetPickupGhost },
{ "UpdatePickupGhosts", Lua_PickupUpdatePickupGhosts },
{ "TriggerTheresOptionsPickup", Lua_PickupTriggerTheresOptionsPickup },
{ NULL, NULL }
};

Expand Down
6 changes: 3 additions & 3 deletions repentogon/LuaInterfaces/LuaASM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void RegisterASMPatchTest(lua_State* L) {
lua_register(L, "ASMPatch", Lua_NewASMPatch);
}

HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
/* HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
super();
lua_State* state = g_LuaEngine->_state;
lua::LuaStackProtector protector(state);
Expand All @@ -291,6 +291,6 @@ HOOK_METHOD(LuaEngine, RegisterClasses, () -> void) {
RegisterASMPatchTest(state);
lua_register(state, "Disassemble", Lua_Disassemble);
};
}; */

#endif
#endif

0 comments on commit ff75d0f

Please sign in to comment.