Skip to content

Commit e01a72b

Browse files
committed
Add RegisterEvent support to World State for CMaNGOS
1 parent 62d38c1 commit e01a72b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

methods/CMangos/WorldObjectMethods.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ namespace LuaWorldObject
766766
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
767767
if (functionRef != LUA_REFNIL && functionRef != LUA_NOREF)
768768
{
769-
obj->elunaEvents->AddEvent(functionRef, min, max, repeats);
769+
obj->GetElunaEvents(E->GetBoundMapId())->AddEvent(functionRef, min, max, repeats);
770770
E->Push(functionRef);
771771
}
772772
return 1;
@@ -780,17 +780,17 @@ namespace LuaWorldObject
780780
int RemoveEventById(Eluna* E, WorldObject* obj)
781781
{
782782
int eventId = E->CHECKVAL<int>(2);
783-
obj->elunaEvents->SetState(eventId, LUAEVENT_STATE_ABORT);
783+
obj->GetElunaEvents(E->GetBoundMapId())->SetState(eventId, LUAEVENT_STATE_ABORT);
784784
return 0;
785785
}
786786

787787
/**
788788
* Removes all timed events from a [WorldObject]
789789
*
790790
*/
791-
int RemoveEvents(Eluna* /*E*/, WorldObject* obj)
791+
int RemoveEvents(Eluna* E, WorldObject* obj)
792792
{
793-
obj->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
793+
obj->GetElunaEvents(E->GetBoundMapId())->SetStates(LUAEVENT_STATE_ABORT);
794794
return 0;
795795
}
796796

@@ -1183,9 +1183,9 @@ namespace LuaWorldObject
11831183
{ "SummonGameObject", &LuaWorldObject::SummonGameObject },
11841184
{ "SpawnCreature", &LuaWorldObject::SpawnCreature },
11851185
{ "SendPacket", &LuaWorldObject::SendPacket },
1186-
{ "RegisterEvent", &LuaWorldObject::RegisterEvent, METHOD_REG_MAP }, // Map state method only in multistate
1187-
{ "RemoveEventById", &LuaWorldObject::RemoveEventById, METHOD_REG_MAP }, // Map state method only in multistate
1188-
{ "RemoveEvents", &LuaWorldObject::RemoveEvents, METHOD_REG_MAP }, // Map state method only in multistate
1186+
{ "RegisterEvent", &LuaWorldObject::RegisterEvent },
1187+
{ "RemoveEventById", &LuaWorldObject::RemoveEventById },
1188+
{ "RemoveEvents", &LuaWorldObject::RemoveEvents },
11891189
{ "PlayMusic", &LuaWorldObject::PlayMusic },
11901190
{ "PlayDirectSound", &LuaWorldObject::PlayDirectSound },
11911191
{ "PlayDistanceSound", &LuaWorldObject::PlayDistanceSound },

0 commit comments

Comments
 (0)