fix (core): Prevent Forced UpdateObjectVisibility Before in World (#11730)
fix (Core): Prevent Forced UpdateObjectVisibility Before in World TC Cherry Pick: https://github.com/TrinityCore/TrinityCore/commit/38dc5667ba13d5c1d094330b0f57ba0ee9b2dde5 Co-Authored-By: Shauren <shauren.trinity@gmail.com> Co-Authored-By: Jurgis <326232+chemicstry@users.noreply.github.com> Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Jurgis <326232+chemicstry@users.noreply.github.com>
This commit is contained in:
@@ -1548,6 +1548,10 @@ void Player::UpdateVisibilityForPlayer(bool mapChange)
|
|||||||
|
|
||||||
void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
||||||
{
|
{
|
||||||
|
// Prevent updating visibility if player is not in world (example: LoadFromDB sets drunkstate which updates invisibility while player is not in map)
|
||||||
|
if (!IsInWorld())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!forced)
|
if (!forced)
|
||||||
AddToNotify(NOTIFY_VISIBILITY_CHANGED);
|
AddToNotify(NOTIFY_VISIBILITY_CHANGED);
|
||||||
else if (!isBeingLoaded())
|
else if (!isBeingLoaded())
|
||||||
|
|||||||
Reference in New Issue
Block a user