[11123] Move respawn data to InstanceSave.

This make prev commit more useful.
In future InstanceSave also planned store local pools state.
This commit is contained in:
VladimirMangos 2011-02-08 06:30:44 +03:00
parent 852c4ddf32
commit 6cfa64db97
13 changed files with 258 additions and 191 deletions

View file

@ -21,6 +21,7 @@
#include "ObjectGuid.h"
#include "ProgressBar.h"
#include "Log.h"
#include "InstanceSaveMgr.h"
#include "MapManager.h"
#include "World.h"
#include "Policies/SingletonImp.h"
@ -400,7 +401,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj, bool instantly)
// for not loaded grid just update respawn time (avoid work for instances until implemented support)
else if(!instantly)
{
sObjectMgr.SaveCreatureRespawnTime(obj->guid, 0 /*map->GetInstanceId()*/, time(NULL) + data->spawntimesecs);
map->GetInstanceSave()->SaveCreatureRespawnTime(obj->guid, time(NULL) + data->spawntimesecs);
}
}
}
@ -452,7 +453,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj, bool instantly)
{
// for spawned by default object only
if (data->spawntimesecs >= 0)
sObjectMgr.SaveGORespawnTime(obj->guid, 0 /*map->GetInstanceId()*/, time(NULL) + data->spawntimesecs);
map->GetInstanceSave()->SaveGORespawnTime(obj->guid, time(NULL) + data->spawntimesecs);
}
}
}