Core/Maps: All RespawnInfo* handed to outside code are now RespawnInfo const*, to signify that outside code has zero business changing these.

This commit is contained in:
Treeston
2020-12-31 18:56:53 +01:00
parent 7d70fbc64c
commit 803dc789e4
4 changed files with 16 additions and 14 deletions

View File

@@ -633,7 +633,7 @@ public:
handler->PSendSysMessage(LANG_LIST_RESPAWNS_ZONE, EnumUtils::ToTitle(type), zoneName, zoneId);
handler->PSendSysMessage(LANG_LIST_RESPAWNS_LISTHEADER);
std::vector<RespawnInfo*> respawns;
std::vector<RespawnInfo const*> respawns;
map->GetRespawnInfo(respawns, SpawnObjectTypeMask(1 << type));
for (RespawnInfo const* ri : respawns)
{

View File

@@ -1824,12 +1824,12 @@ public:
Cell::VisitGridObjects(player, worker, player->GetGridActivationRange());
// Now handle any that had despawned, but had respawn time logged.
std::vector<RespawnInfo*> data;
std::vector<RespawnInfo const*> data;
player->GetMap()->GetRespawnInfo(data, SPAWN_TYPEMASK_ALL);
if (!data.empty())
{
uint32 const gridId = Trinity::ComputeGridCoord(player->GetPositionX(), player->GetPositionY()).GetId();
for (RespawnInfo* info : data)
for (RespawnInfo const* info : data)
if (info->gridId == gridId)
player->GetMap()->Respawn(info->type, info->spawnId);
}