Core/Corpses: Fixed crash in corpse creation

This commit is contained in:
Shauren
2022-04-24 14:31:55 +02:00
parent 22edf79c70
commit 5e90f188f8
3 changed files with 5 additions and 5 deletions

View File

@@ -89,9 +89,6 @@ bool Corpse::Create(ObjectGuid::LowType guidlow, Player* owner)
PhasingHandler::InheritPhaseShift(this, owner);
UpdatePositionData();
SetZoneScript();
return true;
}

View File

@@ -4492,6 +4492,9 @@ Corpse* Player::CreateCorpse()
// register for player, but not show
GetMap()->AddCorpse(corpse);
corpse->UpdatePositionData();
corpse->SetZoneScript();
// we do not need to save corpses for BG/arenas
if (!GetMap()->IsBattlegroundOrArena())
corpse->SaveToDB();

View File

@@ -4873,11 +4873,11 @@ Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, bool insignia /*=
PhasingHandler::InheritPhaseShift(bones, corpse);
AddCorpse(bones);
bones->UpdatePositionData();
bones->SetZoneScript();
AddCorpse(bones);
// add bones in grid store if grid loaded where corpse placed
AddToMap(bones);
}