Core/Corpses: Fixed crash in corpse creation

Port From (https://github.com/TrinityCore/TrinityCore/commit/5e90f188f80d217b95606caf745e82253f3a4d47)
This commit is contained in:
hondacrx
2022-05-31 20:02:02 -04:00
parent a0b381ed79
commit c5593ea980
3 changed files with 5 additions and 5 deletions
-3
View File
@@ -89,9 +89,6 @@ namespace Game.Entities
PhasingHandler.InheritPhaseShift(this, owner);
UpdatePositionData();
SetZoneScript();
return true;
}
+3
View File
@@ -4536,6 +4536,9 @@ namespace Game.Entities
// 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();
+2 -2
View File
@@ -3411,11 +3411,11 @@ namespace Game.Maps
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);
}