diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-08-28 09:11:31 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-08-28 09:11:31 +0200 |
commit | dd90e51028b92cfe65abef72f599f32bc896a810 (patch) | |
tree | 8e26775baba43e01c02f2390ddfb5faa15917ff2 /src/server/game/Maps/Map.cpp | |
parent | 88eead2462d64e3de52eaa9a34b2198fe3e7b832 (diff) | |
parent | b099e4e43a84b661543d62cb507c599263c40fbb (diff) |
Merge pull request #15359 from pete318/map_instance6x
Core/Maps: Prevent assert when entering instance on second character with corpse inside.
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 1fdd92de91c..b10d6aa6896 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3564,9 +3564,10 @@ void Map::LoadCorpseData() PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSE_PHASES); stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); // 0 1 - // SELECT OwnerGuid, PhaseId FROM corpse_phases cp LEFT JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? + // SELECT OwnerGuid, PhaseId FROM corpse_phases cp LEFT JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ? PreparedQueryResult phaseResult = CharacterDatabase.Query(stmt); if (phaseResult) { @@ -3583,9 +3584,10 @@ void Map::LoadCorpseData() stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES); stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, guid FROM corpse WHERE mapId = ? + // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, guid FROM corpse WHERE mapId = ? AND instanceId = ? PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; @@ -3619,8 +3621,10 @@ void Map::LoadCorpseData() void Map::DeleteCorpseData() { + // DELETE cp, c FROM corpse_phases cp INNER JOIN corpse c ON cp.OwnerGuid = c.guid WHERE c.mapId = ? AND c.instanceId = ? PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CORPSES_FROM_MAP); stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, GetInstanceId()); CharacterDatabase.Execute(stmt); } |