mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9422] Return success result for Zone<->map coordinates convertions.
This will prevent #INF-inity values in gps for zones where zone coordinates calculation impossible with current code. Also fix small typo in debug output format for honor
This commit is contained in:
parent
a916e31316
commit
b2019913d4
5 changed files with 25 additions and 12 deletions
|
|
@ -294,7 +294,11 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
|||
float zone_x = obj->GetPositionX();
|
||||
float zone_y = obj->GetPositionY();
|
||||
|
||||
Map2ZoneCoordinates(zone_x,zone_y,zone_id);
|
||||
if (Map2ZoneCoordinates(zone_x,zone_y,zone_id))
|
||||
{
|
||||
zone_x = 0;
|
||||
zone_y = 0;
|
||||
}
|
||||
|
||||
Map const *map = obj->GetMap();
|
||||
float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT);
|
||||
|
|
@ -2409,7 +2413,12 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
Zone2MapCoordinates(x,y,zoneEntry->ID);
|
||||
if (!Zone2MapCoordinates(x,y,zoneEntry->ID))
|
||||
{
|
||||
PSendSysMessage(LANG_INVALID_ZONE_MAP,areaEntry->ID,areaEntry->area_name[GetSessionDbcLocale()],map->GetId(),map->GetMapName());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!MapManager::IsValidMapCoord(zoneEntry->mapid,x,y))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue