Skip to content

Commit 52d3c75

Browse files
committed
VMaNGOS: Add RegisterEvent support to World State and add method flags to functions
1 parent 29bfe53 commit 52d3c75

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

methods/VMangos/GlobalMethods.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,11 +2971,11 @@ namespace LuaGlobalFunctions
29712971
{ "ReloadEluna", &LuaGlobalFunctions::ReloadEluna },
29722972
{ "RunCommand", &LuaGlobalFunctions::RunCommand },
29732973
{ "SendWorldMessage", &LuaGlobalFunctions::SendWorldMessage },
2974-
{ "WorldDBQuery", &LuaGlobalFunctions::WorldDBQuery },
2974+
{ "WorldDBQuery", &LuaGlobalFunctions::WorldDBQuery, METHOD_REG_ALL, METHOD_FLAG_UNSAFE },
29752975
{ "WorldDBExecute", &LuaGlobalFunctions::WorldDBExecute },
2976-
{ "CharDBQuery", &LuaGlobalFunctions::CharDBQuery },
2976+
{ "CharDBQuery", &LuaGlobalFunctions::CharDBQuery, METHOD_REG_ALL, METHOD_FLAG_UNSAFE },
29772977
{ "CharDBExecute", &LuaGlobalFunctions::CharDBExecute },
2978-
{ "AuthDBQuery", &LuaGlobalFunctions::AuthDBQuery },
2978+
{ "AuthDBQuery", &LuaGlobalFunctions::AuthDBQuery, METHOD_REG_ALL, METHOD_FLAG_UNSAFE },
29792979
{ "AuthDBExecute", &LuaGlobalFunctions::AuthDBExecute },
29802980
{ "CreateLuaEvent", &LuaGlobalFunctions::CreateLuaEvent },
29812981
{ "RemoveEventById", &LuaGlobalFunctions::RemoveEventById },

methods/VMangos/WorldObjectMethods.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ namespace LuaWorldObject
735735
int functionRef = luaL_ref(E->L, LUA_REGISTRYINDEX);
736736
if (functionRef != LUA_REFNIL && functionRef != LUA_NOREF)
737737
{
738-
obj->elunaEvents->AddEvent(functionRef, min, max, repeats);
738+
obj->GetElunaEvents(E->GetBoundMapId())->AddEvent(functionRef, min, max, repeats);
739739
E->Push(functionRef);
740740
}
741741
return 1;
@@ -749,17 +749,17 @@ namespace LuaWorldObject
749749
int RemoveEventById(Eluna* E, WorldObject* obj)
750750
{
751751
int eventId = E->CHECKVAL<int>(2);
752-
obj->elunaEvents->SetState(eventId, LUAEVENT_STATE_ABORT);
752+
obj->GetElunaEvents(E->GetBoundMapId())->SetState(eventId, LUAEVENT_STATE_ABORT);
753753
return 0;
754754
}
755755

756756
/**
757757
* Removes all timed events from a [WorldObject]
758758
*
759759
*/
760-
int RemoveEvents(Eluna* /*E*/, WorldObject* obj)
760+
int RemoveEvents(Eluna* E, WorldObject* obj)
761761
{
762-
obj->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
762+
obj->GetElunaEvents(E->GetBoundMapId())->SetStates(LUAEVENT_STATE_ABORT);
763763
return 0;
764764
}
765765

0 commit comments

Comments
 (0)