mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
fix(Core/Grids): Standardize grid coordinates (#21479)
This commit is contained in:
@@ -567,7 +567,8 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Cell cell(Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()));
|
||||
CellCoord const cellCoord = Acore::ComputeCellCoord(object->GetPositionX(), object->GetPositionY());
|
||||
Cell cell(cellCoord);
|
||||
|
||||
uint32 zoneId, areaId;
|
||||
object->GetZoneAndAreaId(zoneId, areaId);
|
||||
@@ -584,14 +585,8 @@ public:
|
||||
float groundZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
|
||||
float floorZ = object->GetMapHeight(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
|
||||
|
||||
GridCoord gridCoord = Acore::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
|
||||
|
||||
// 63? WHY?
|
||||
int gridX = 63 - gridCoord.x_coord;
|
||||
int gridY = 63 - gridCoord.y_coord;
|
||||
|
||||
uint32 haveMap = GridTerrainLoader::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
|
||||
uint32 haveVMap = GridTerrainLoader::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0;
|
||||
uint32 haveMap = GridTerrainLoader::ExistMap(object->GetMapId(), cell.GridX(), cell.GridY()) ? 1 : 0;
|
||||
uint32 haveVMap = GridTerrainLoader::ExistVMap(object->GetMapId(), cell.GridX(), cell.GridY()) ? 1 : 0;
|
||||
uint32 haveMMAP = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()) ? 1 : 0;
|
||||
|
||||
if (haveVMap)
|
||||
|
||||
@@ -133,11 +133,10 @@ public:
|
||||
// grid tile location
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS;
|
||||
int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS;
|
||||
GridCoord const gridCoord = Acore::ComputeGridCoord(player->GetPositionX(), player->GetPositionY());
|
||||
|
||||
handler->PSendSysMessage("{}{}{}.mmtile", player->GetMapId(), gx, gy);
|
||||
handler->PSendSysMessage("gridloc [{}, {}]", gy, gx);
|
||||
handler->PSendSysMessage("{}{}{}.mmtile", player->GetMapId(), gridCoord.x_coord, gridCoord.y_coord);
|
||||
handler->PSendSysMessage("gridloc [{}, {}]", gridCoord.x_coord, gridCoord.y_coord);
|
||||
|
||||
// calculate navmesh tile location
|
||||
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId());
|
||||
|
||||
Reference in New Issue
Block a user