[7554] Prevent accepting wrong numeric args as 0.0f in .go zone command

This commit is contained in:
VladimirMangos 2009-03-27 20:29:16 +03:00
parent b768401438
commit cc19245ce4
2 changed files with 6 additions and 1 deletions

View file

@ -2432,6 +2432,11 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
float x = (float)atof(px);
float y = (float)atof(py);
// prevent accept wrong numeric args
if (x==0.0f && *px!='0' || y==0.0f && *py!='0')
return false;
uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaid);