mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
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 28b3469e89)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -258,6 +258,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdatePositionData();
|
||||
|
||||
SetZoneScript();
|
||||
if (m_zoneScript)
|
||||
{
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user