static void UpdateVisibilityIfNeeded(WorldObject obj, bool updateVisibility, bool changed) { if (changed && obj.IsInWorld) { Player player = obj.ToPlayer(); if (player) { SendToPlayer(player); } if (updateVisibility) { if (player) { player.GetMap().SendUpdateTransportVisibility(player); } obj.UpdateObjectVisibility(); } } }