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:
Treeston
2017-07-23 00:01:11 +02:00
committed by Shauren
parent b630e9a485
commit e6be53d141
3 changed files with 5 additions and 0 deletions

View File

@@ -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)

View File

@@ -258,6 +258,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
return false;
}
UpdatePositionData();
SetZoneScript();
if (m_zoneScript)
{

View File

@@ -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())