fix (core): Prevent Forced UpdateObjectVisibility Before in World (#11730)

fix (Core): Prevent Forced UpdateObjectVisibility Before in World

TC Cherry Pick: 38dc5667ba

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:
acidmanifesto
2022-05-13 13:02:43 -04:00
committed by GitHub
parent 06a62538cf
commit 11f151a962

View File

@@ -1548,6 +1548,10 @@ void Player::UpdateVisibilityForPlayer(bool mapChange)
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)
AddToNotify(NOTIFY_VISIBILITY_CHANGED);
else if (!isBeingLoaded())