diff --git a/TrinityCore/GlobalMethods.h b/TrinityCore/GlobalMethods.h index 6633c317a8..b490bdacd2 100644 --- a/TrinityCore/GlobalMethods.h +++ b/TrinityCore/GlobalMethods.h @@ -86,6 +86,17 @@ namespace LuaGlobalFunctions return 1; } + /** + * Returns the map ID of the Lua state. Returns -1 for the "World" state. + * + * @return int32 mapId + */ + int GetStateMapId(Eluna* E) + { + E->Push(E->GetBoundMapId()); + return 1; + } + /** * Returns [Quest] template * @@ -2934,6 +2945,7 @@ namespace LuaGlobalFunctions { "GetRealmID", &LuaGlobalFunctions::GetRealmID }, { "GetCoreVersion", &LuaGlobalFunctions::GetCoreVersion }, { "GetCoreExpansion", &LuaGlobalFunctions::GetCoreExpansion }, + { "GetStateMapId", &LuaGlobalFunctions::GetStateMapId }, { "GetQuest", &LuaGlobalFunctions::GetQuest }, { "GetPlayerByGUID", &LuaGlobalFunctions::GetPlayerByGUID }, { "GetPlayerByName", &LuaGlobalFunctions::GetPlayerByName },