[11122] Create InstanceSave for non-instanceable maps.

This preparation for use structure for store another map persistance data like respawn times.
This commit is contained in:
VladimirMangos 2011-02-08 00:14:10 +03:00
parent cd867eadef
commit 852c4ddf32
5 changed files with 128 additions and 72 deletions

View file

@ -94,6 +94,9 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
//add reference for TerrainData object
m_TerrainData->AddRef();
m_instanceSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), GetDifficulty(), 0, Instanceable());
m_instanceSave->SetUsedByMapState(true);
}
void Map::InitVisibilityDistance()
@ -1311,13 +1314,6 @@ InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 Spaw
// the timer is started by default, and stopped when the first player joins
// this make sure it gets unloaded if for some reason no player joins
m_unloadTimer = std::max(sWorld.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
// Dungeon only code
if(IsDungeon())
{
m_instanceSave = sInstanceSaveMgr.AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
m_instanceSave->SetUsedByMapState(true);
}
}
InstanceMap::~InstanceMap()