diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-06-08 14:52:52 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-06-08 14:52:52 +0200 |
commit | 32aa983fe23ffc49ae0cf5322bae9f31beab5d47 (patch) | |
tree | 7891c5622f0d3aa14c26655e3dfe21cf5a5b7bb7 /src/server/game/Maps/Map.cpp | |
parent | 1c0fc0a1eea8dc5ae1581b67b94473e669375902 (diff) |
Core/Maps: Fixed possible crash when resetting instances
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rwxr-xr-x | src/server/game/Maps/Map.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 6f19fdcbc0a..82659e32016 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2880,14 +2880,19 @@ void Map::DeleteRespawnTimes() _creatureRespawnTimes.clear(); _goRespawnTimes.clear(); + DeleteRespawnTimesInDB(GetId(), GetInstanceId()); +} + +void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId) +{ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE); - stmt->setUInt16(0, GetId()); - stmt->setUInt32(1, GetInstanceId()); + stmt->setUInt16(0, mapId); + stmt->setUInt32(1, instanceId); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GO_RESPAWN_BY_INSTANCE); - stmt->setUInt16(0, GetId()); - stmt->setUInt32(1, GetInstanceId()); + stmt->setUInt16(0, mapId); + stmt->setUInt32(1, instanceId); CharacterDatabase.Execute(stmt); } @@ -2906,3 +2911,4 @@ time_t Map::GetLinkedRespawnTime(uint64 guid) const return time_t(0); } + |