Core/Maps: Removed MapInstanced - no longer neccessary for grid data reference counting (moved to TerrainInfo)
This commit is contained in:
1 parent
f879d95589
commit
81b2ff0d94
33 files changed
+538
-764
No files matched your search
@@ -27,7 +27,6 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
#include "MapInstanced.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
@@ -597,7 +596,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
|
||||
void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||
{
|
||||
TC_LOG_DEBUG("maps", "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId);
|
||||
Map const* map = sMapMgr->CreateBaseMap(mapid);
|
||||
MapEntry const* map = sMapStore.LookupEntry(mapid);
|
||||
if (!map->IsDungeon())
|
||||
return;
|
||||
|
||||
@@ -607,7 +606,7 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
|
||||
|
||||
DeleteInstanceFromDB(instanceId); // even if save not loaded
|
||||
|
||||
Map* iMap = ((MapInstanced*)map)->FindInstanceMap(instanceId);
|
||||
Map* iMap = sMapMgr->FindMap(mapid, instanceId);
|
||||
|
||||
if (iMap)
|
||||
{
|
||||
@@ -687,28 +686,23 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b
|
||||
}
|
||||
|
||||
// note: this isn't fast but it's meant to be executed very rarely
|
||||
Map const* map = sMapMgr->CreateBaseMap(mapid); // _not_ include difficulty
|
||||
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
MapInstanced::InstancedMaps::iterator mitr;
|
||||
uint32 timeLeft;
|
||||
|
||||
for (mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
|
||||
if (mapEntry->IsDungeon())
|
||||
{
|
||||
Map* map2 = mitr->second;
|
||||
if (!map2->IsDungeon())
|
||||
continue;
|
||||
|
||||
if (warn)
|
||||
sMapMgr->DoForAllMapsWithMapId(mapid, [=](Map* map)
|
||||
{
|
||||
if (now >= resetTime)
|
||||
timeLeft = 0;
|
||||
else
|
||||
timeLeft = uint32(resetTime - now);
|
||||
if (warn)
|
||||
{
|
||||
uint32 timeLeft;
|
||||
if (now >= resetTime)
|
||||
timeLeft = 0;
|
||||
else
|
||||
timeLeft = uint32(resetTime - now);
|
||||
|
||||
((InstanceMap*)map2)->SendResetWarnings(timeLeft);
|
||||
}
|
||||
else
|
||||
((InstanceMap*)map2)->Reset(INSTANCE_RESET_GLOBAL);
|
||||
((InstanceMap*)map)->SendResetWarnings(timeLeft);
|
||||
}
|
||||
else
|
||||
((InstanceMap*)map)->Reset(INSTANCE_RESET_GLOBAL);
|
||||
});
|
||||
}
|
||||
|
||||
/// @todo delete creature/gameobject respawn times even if the maps are not loaded
|
||||
|
||||
Reference in new issue
Block a user