mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
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:
@@ -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