Core/Instance: stop updating the instance resettimes based on creature respawns

- Rather update normal instance reset time to 2 hours after last creature kill
- This fixes yet another integer overflow due to the possibility of having time_t max showing up
- Also change respawntime and resettime fields to bigint on respawn/instance related tables
- Start using prepared statements on the InstanceSaveMgr
This commit is contained in:
ariel-
2017-04-11 23:57:29 -03:00
parent e32a4f26aa
commit 4c593f12ca
8 changed files with 53 additions and 46 deletions
+1 -1
View File
@@ -12132,7 +12132,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
{
// the reset time is set but not added to the scheduler
// until the players leave the instance
time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR;
time_t resettime = GameTime::GetGameTime() + 2 * HOUR;
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId()))
if (save->GetResetTime() < resettime)
save->SetResetTime(resettime);