diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-12-13 18:38:31 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-12-13 18:38:31 +0100 |
commit | 93f2affbf2f70c619cdc41b073dd19827df20448 (patch) | |
tree | be8a2ec3e25ad3109feb8450660d52eb2955789b /src/server/game/Maps/Map.cpp | |
parent | 015666b0442ac2d4f34874da068f31f58d2580e9 (diff) |
Core/Corpses: Fixed client crashes with player corpses
Closes #25714
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index c77af89ae93..5d8c07dd2da 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -4789,8 +4789,8 @@ void Map::LoadCorpseData() 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 = ? AND instanceId = ? + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, race, class, gender, flags, dynFlags, time, corpseType, instanceId, guid FROM corpse WHERE mapId = ? AND instanceId = ? PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; @@ -4838,8 +4838,8 @@ void Map::LoadCorpseData() do { Field* fields = result->Fetch(); - CorpseType type = CorpseType(fields[12].GetUInt8()); - ObjectGuid::LowType guid = fields[14].GetUInt64(); + CorpseType type = CorpseType(fields[13].GetUInt8()); + ObjectGuid::LowType guid = fields[15].GetUInt64(); if (type >= MAX_CORPSE_TYPE || type == CORPSE_BONES) { TC_LOG_ERROR("misc", "Corpse (guid: " UI64FMTD ") have wrong corpse type (%u), not loading.", guid, type); @@ -4935,11 +4935,10 @@ Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*= bones->SetDisplayId(corpse->m_corpseData->DisplayID); bones->SetRace(corpse->m_corpseData->RaceID); bones->SetSex(corpse->m_corpseData->Sex); + bones->SetClass(corpse->m_corpseData->Class); bones->SetCustomizations(Trinity::Containers::MakeIteratorPair(corpse->m_corpseData->Customizations.begin(), corpse->m_corpseData->Customizations.end())); bones->SetFlags(corpse->m_corpseData->Flags | CORPSE_FLAG_BONES); bones->SetFactionTemplate(corpse->m_corpseData->FactionTemplate); - for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) - bones->SetItem(i, corpse->m_corpseData->Items[i]); bones->SetCellCoord(corpse->GetCellCoord()); bones->Relocate(corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetOrientation()); |