mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Scripts/Commands): make sure no invalid IDs can be passed in map creation for .go xyz (#17836)
* handle wrong ID * remove enum * white line at end got removed for some reason idk * a tab
This commit is contained in:
@@ -337,10 +337,19 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
uint32 mapId = locationValues.size() >= 4 ? uint32(locationValues[3]) : player->GetMapId();
|
||||
Map const* map = sMapMgr->CreateBaseMap(mapId);
|
||||
|
||||
float x = locationValues[0];
|
||||
float y = locationValues[1];
|
||||
|
||||
if (mapId == MAPID_INVALID)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, mapId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Map const* map = sMapMgr->CreateBaseMap(mapId);
|
||||
|
||||
float z = locationValues.size() >= 3 ? locationValues[2] : std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
|
||||
// map ID (locationValues[3]) already handled above
|
||||
float o = locationValues.size() >= 5 ? locationValues[4] : player->GetOrientation();
|
||||
|
||||
Reference in New Issue
Block a user