diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2017-07-23 00:01:11 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-20 00:18:48 +0200 |
| commit | e6be53d1417e733f0916ff305960cfac3e2ca551 (patch) | |
| tree | 7b13a58057e93a7128d0aaf2e446317103489f24 /src | |
| parent | b630e9a48598847cfa389ee921e37eb273bf79c2 (diff) | |
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. Closes #20028.
(cherry picked from commit 28b3469e89f89a8c87fad06bad27800939abf0f5)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3bf69feecca..17d3be260ee 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1037,6 +1037,7 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 entry, float TC_LOG_ERROR("entities.unit", "Creature::Create(): given coordinates for creature (guidlow " UI64FMTD ", entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", 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->type_flags & CREATURE_TYPE_FLAG_GHOST_VISIBLE) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index cccf3a8bf29..921fc20f5e7 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -258,6 +258,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD return false; } + UpdatePositionData(); + SetZoneScript(); if (m_zoneScript) { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a2e6e300042..c0dc3695161 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -446,6 +446,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac } SetMap(sMapMgr->CreateMap(info->mapId, this)); + UpdatePositionData(); uint8 powertype = cEntry->DisplayPower; @@ -18283,6 +18284,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder) } SetMap(map); + UpdatePositionData(); // now that map position is determined, check instance validity if (!CheckInstanceValidity(true) && !IsInstanceLoginGameMasterException()) |
