Core/WorldObject: Properly initialize position data for all types when initially creating them. Fixes some issues with PvP objectives not having the correct area ID set on initialization.

Port From (https://github.com/TrinityCore/TrinityCore/commit/e6be53d1417e733f0916ff305960cfac3e2ca551)
This commit is contained in:
hondacrx
2020-08-22 15:30:16 -04:00
parent 5f53919281
commit 7060f728a3
4 changed files with 5 additions and 0 deletions
@@ -774,6 +774,7 @@ namespace Game.Entities
Log.outError(LogFilter.Unit, "Creature.Create: given coordinates for creature (guidlow {0}, entry {1}) are not valid (X: {2}, Y: {3}, Z: {4}, O: {5})", guidlow, entry, x, y, z, ang);
return false;
}
UpdatePositionData();
// Allow players to see those units while dead, do it here (mayby altered by addon auras)
if (cinfo.TypeFlags.HasAnyFlag(CreatureTypeFlags.GhostVisible))
@@ -194,6 +194,8 @@ namespace Game.Entities
return false;
}
UpdatePositionData();
SetZoneScript();
if (m_zoneScript != null)
{
+1
View File
@@ -2841,6 +2841,7 @@ namespace Game.Entities
}
SetMap(map);
UpdatePositionData();
// now that map position is determined, check instance validity
if (!CheckInstanceValidity(true) && !IsInstanceLoginGameMasterException())
+1
View File
@@ -192,6 +192,7 @@ namespace Game.Entities
}
SetMap(Global.MapMgr.CreateMap(info.MapId, this));
UpdatePositionData();
PowerType powertype = cEntry.DisplayPower;