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

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-28 16:13:33 -06:00
parent eb894f39e8
commit 494e09ba92
+5
View File
@@ -2860,6 +2860,11 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args)
float x = (float)atof(px); float x = (float)atof(px);
float y = (float)atof(py); 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(); uint32 areaid = cAreaId ? (uint32)atoi(cAreaId) : _player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaid); AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaid);