Skip to content

Commit

Permalink
Add method to fetch a states' map id
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jan 7, 2024
1 parent 59cce10 commit 7b2ebbf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions TrinityCore/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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 },
Expand Down

0 comments on commit 7b2ebbf

Please sign in to comment.