Core/Maps: Replace some Instanceable() checks with IsDungeon()

This commit is contained in:
Shauren authored and Ovahlord committed 2022-12-26 13:40:18 +01:00
1 parent 265c2fa508
commit b732521f17
5 files changed
+9 -13

No files matched your search

@@ -598,7 +598,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
{
TC_LOG_DEBUG("maps", "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
Map const* map = sMapMgr->CreateBaseMap(mapid);
if (!map->Instanceable())
if (!map->IsDungeon())
return;
InstanceSaveHashMap::iterator itr = m_instanceSaveById.find(instanceId);
@@ -609,11 +609,9 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
Map* iMap = ((MapInstanced*)map)->FindInstanceMap(instanceId);
if (iMap && iMap->IsDungeon())
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
if (iMap)
{
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
iMap->DeleteRespawnTimes();
iMap->DeleteCorpseData();
}
+1 -1
View File
@@ -138,7 +138,7 @@ Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32
}
}
}
else
else if (IsDungeon())
{
InstancePlayerBind* pBind = player->GetBoundInstance(GetId(), player->GetDifficulty(IsRaid()));
InstanceSave* pSave = pBind ? pBind->save : nullptr;
+4 -6
View File
@@ -293,11 +293,10 @@ uint32 MapManager::GetNumInstances()
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
{
Map* map = itr->second;
if (!map->Instanceable())
if (!map->IsDungeon())
continue;
MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
if (mitr->second->IsDungeon()) ret++;
ret += maps.size();
}
return ret;
}
@@ -310,12 +309,11 @@ uint32 MapManager::GetNumPlayersInInstances()
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
{
Map* map = itr->second;
if (!map->Instanceable())
if (!map->IsDungeon())
continue;
MapInstanced::InstancedMaps &maps = ((MapInstanced*)map)->GetInstancedMaps();
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
if (mitr->second->IsDungeon())
ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize();
ret += mitr->second->GetPlayers().getSize();
}
return ret;
}
+1 -1
View File
@@ -320,7 +320,7 @@ public:
std::shared_ptr<TerrainInfo> terrain = sTerrainMgr.LoadTerrain(zoneEntry->ContinentID);
MapEntry const* mapEntry = sMapStore.LookupEntry(terrain->GetId());
if (!mapEntry || !mapEntry->Instanceable())
if (!mapEntry || !mapEntry->IsDungeon())
{
handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->AreaName, terrain->GetId(), terrain->GetMapName());
handler->SetSentErrorMessage(true);
+1 -1
View File
@@ -550,7 +550,7 @@ public:
if (!target->GetMap()->IsBattlegroundOrArena())
target->SetBattlegroundEntryPoint();
}
else if (map->Instanceable())
else if (map->IsDungeon())
{
Map* targetMap = target->GetMap();
Player* targetGroupLeader = nullptr;