mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/Maps: fixed a crash regarding terrain swap grids
This commit is contained in:
@@ -2360,7 +2360,7 @@ GridMap* Map::GetGrid(uint32 mapId, float x, float y)
|
||||
|
||||
GridMap* grid = GridMaps[gx][gy];
|
||||
auto childMapItr = std::find_if(m_childTerrainMaps->begin(), m_childTerrainMaps->end(), [mapId](Map* childTerrainMap) { return childTerrainMap->GetId() == mapId; });
|
||||
if (childMapItr != m_childTerrainMaps->end() && (*childMapItr)->GridMaps[gx][gy]->fileExists())
|
||||
if (childMapItr != m_childTerrainMaps->end() && (*childMapItr)->GridMaps[gx][gy] && (*childMapItr)->GridMaps[gx][gy]->fileExists())
|
||||
grid = (*childMapItr)->GridMaps[gx][gy];
|
||||
|
||||
return grid;
|
||||
|
||||
@@ -794,7 +794,7 @@ public:
|
||||
std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true);
|
||||
std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true);
|
||||
|
||||
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetName().c_str(), target->GetSpawnId(), target->GetGUID().GetCounter(), entry, faction, npcflags, displayid, nativeid);
|
||||
handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, faction, npcflags, displayid, nativeid);
|
||||
if (target->GetCreatureData() && target->GetCreatureData()->spawnGroupData->groupId)
|
||||
{
|
||||
SpawnGroupTemplateData const* const groupData = target->GetCreatureData()->spawnGroupData;
|
||||
|
||||
Reference in New Issue
Block a user