[11137] Fixed crash at reset normal dungeon while map loaded.

* Map Persistent noe have direct pointer back to map if map loaded.
  That let simplify some code and avoid map search.
* Crash showup in result changes in code logic related to reset processing.
* Also fix more old bug with reset normal dungeon with not loaded map.
* Reverse MapPersistentState::HasRespawnTimes and MapPersistentState::HasBounds() results
  to expected for function names and update related calls.

Thanks to Schmoozerd for help in research problem.
This commit is contained in:
VladimirMangos 2011-02-12 03:14:50 +03:00
parent 5858aae4d9
commit 47060fe4b1
5 changed files with 30 additions and 23 deletions

View file

@ -47,7 +47,7 @@ Map::~Map()
sWorld.DecreaseScheduledScriptCount(m_scriptSchedule.size());
if (m_persistentState)
m_persistentState->SetUsedByMapState(false); // field pointer can be deleted after this
m_persistentState->SetUsedByMapState(NULL); // field pointer can be deleted after this
if(i_data)
{
@ -96,7 +96,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
m_TerrainData->AddRef();
m_persistentState = sMapPersistentStateMgr.AddPersistentState(i_mapEntry, GetInstanceId(), GetDifficulty(), 0, IsDungeon());
m_persistentState->SetUsedByMapState(true);
m_persistentState->SetUsedByMapState(this);
}
void Map::InitVisibilityDistance()