diff --git a/code/_onclick/hud/map_view.dm b/code/_onclick/hud/map_view.dm index bc304f20f8a15..06a4197fe45eb 100644 --- a/code/_onclick/hud/map_view.dm +++ b/code/_onclick/hud/map_view.dm @@ -16,10 +16,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/map_view) /atom/movable/screen/map_view/Destroy() for(var/datum/weakref/client_ref in viewers_to_huds) - var/client/our_client = client_ref.resolve() - if(!our_client) - continue - hide_from(our_client.mob) + hide_from_client(client_ref.resolve()) return ..() @@ -55,12 +52,18 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/map_view) return pop_planes /atom/movable/screen/map_view/proc/hide_from(mob/hide_from) - hide_from?.canon_client.clear_map(assigned_map) - var/client_ref = WEAKREF(hide_from?.canon_client) + hide_from_client(hide_from?.canon_client) +/atom/movable/screen/map_view/proc/hide_from_client(client/hide_from) + if(!hide_from) + return + hide_from.clear_map(assigned_map) + + var/datum/weakref/client_ref = WEAKREF(hide_from) // Make sure we clear the *right* hud var/datum/weakref/hud_ref = viewers_to_huds[client_ref] viewers_to_huds -= client_ref + var/datum/hud/clear_from = hud_ref?.resolve() if(!clear_from) return diff --git a/code/game/objects/items/devices/spyglasses.dm b/code/game/objects/items/devices/spyglasses.dm index 58c18f87427df..8d70f3de29215 100644 --- a/code/game/objects/items/devices/spyglasses.dm +++ b/code/game/objects/items/devices/spyglasses.dm @@ -20,7 +20,7 @@ /obj/item/clothing/glasses/sunglasses/spy/proc/on_screen_clear(client/source, window) SIGNAL_HANDLER - linked_bug.cam_screen.hide_from(source.mob) + linked_bug.cam_screen.hide_from_client(source) /obj/item/clothing/glasses/sunglasses/spy/equipped(mob/user, slot) . = ..()