Skip to content

Commit e59dcdd

Browse files
committed
Add RegisterEvent support to World State
1 parent 594c35e commit e59dcdd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

methods/TrinityCore/WorldObjectMethods.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ namespace LuaWorldObject
767767
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
768768
if (functionRef != LUA_REFNIL && functionRef != LUA_NOREF)
769769
{
770-
obj->elunaEvents->AddEvent(functionRef, min, max, repeats);
770+
obj->GetElunaEvents(E->GetBoundMapId())->AddEvent(functionRef, min, max, repeats);
771771
E->Push(functionRef);
772772
}
773773
return 1;
@@ -783,7 +783,7 @@ namespace LuaWorldObject
783783
int RemoveEventById(Eluna* E, WorldObject* obj)
784784
{
785785
int eventId = E->CHECKVAL<int>(2);
786-
obj->elunaEvents->SetState(eventId, LUAEVENT_STATE_ABORT);
786+
obj->GetElunaEvents(E->GetBoundMapId())->SetState(eventId, LUAEVENT_STATE_ABORT);
787787
return 0;
788788
}
789789

@@ -793,9 +793,9 @@ namespace LuaWorldObject
793793
* In multistate, this method is only available in the MAP states
794794
*
795795
*/
796-
int RemoveEvents(Eluna* /*E*/, WorldObject* obj)
796+
int RemoveEvents(Eluna* E, WorldObject* obj)
797797
{
798-
obj->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
798+
obj->GetElunaEvents(E->GetBoundMapId())->SetStates(LUAEVENT_STATE_ABORT);
799799
return 0;
800800
}
801801

@@ -1178,9 +1178,9 @@ namespace LuaWorldObject
11781178
{ "SummonGameObject", &LuaWorldObject::SummonGameObject },
11791179
{ "SpawnCreature", &LuaWorldObject::SpawnCreature },
11801180
{ "SendPacket", &LuaWorldObject::SendPacket },
1181-
{ "RegisterEvent", &LuaWorldObject::RegisterEvent, METHOD_REG_MAP }, // Map state method only in multistate
1182-
{ "RemoveEventById", &LuaWorldObject::RemoveEventById, METHOD_REG_MAP }, // Map state method only in multistate
1183-
{ "RemoveEvents", &LuaWorldObject::RemoveEvents, METHOD_REG_MAP }, // Map state method only in multistate
1181+
{ "RegisterEvent", &LuaWorldObject::RegisterEvent },
1182+
{ "RemoveEventById", &LuaWorldObject::RemoveEventById },
1183+
{ "RemoveEvents", &LuaWorldObject::RemoveEvents },
11841184
{ "PlayMusic", &LuaWorldObject::PlayMusic },
11851185
{ "PlayDirectSound", &LuaWorldObject::PlayDirectSound },
11861186
{ "PlayDistanceSound", &LuaWorldObject::PlayDistanceSound },

0 commit comments

Comments
 (0)