Skip to content

Commit

Permalink
Fix suit sensors not being properly updated when ctrl-clicking (#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Oct 14, 2024
1 parent 2c701e3 commit 66880cc
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
to_chat(user, span_notice("You repair the suit sensors on [src] with [cabling]."))
cabling.use(1)
has_sensor = HAS_SENSORS
update_wearer_status()
return TRUE

if(istype(attacking_item, /obj/item/clothing/accessory))
Expand All @@ -119,6 +120,7 @@
has_sensor = BROKEN_SENSORS
else if(damaged_state == CLOTHING_PRISTINE && has_sensor == BROKEN_SENSORS)
has_sensor = HAS_SENSORS
update_wearer_status()
update_appearance()

/obj/item/clothing/under/emp_act(severity)
Expand All @@ -140,10 +142,7 @@
var/mob/M = loc
to_chat(M,span_warning("The sensors on the [src] change rapidly!"))

if(ishuman(loc))
var/mob/living/carbon/human/ooman = loc
if(ooman.w_uniform == src)
ooman.update_suit_sensors()
update_wearer_status()

/obj/item/clothing/under/visual_equipped(mob/user, slot)
. = ..()
Expand All @@ -163,6 +162,14 @@
freshly_laundered = FALSE
user.add_mood_event("fresh_laundry", /datum/mood_event/fresh_laundry)

/obj/item/clothing/under/proc/update_wearer_status()
if(!ishuman(loc))
return

var/mob/living/carbon/human/ooman = loc
ooman.update_suit_sensors()
ooman.med_hud_set_status()

/mob/living/carbon/human/update_suit_sensors()
. = ..()
update_sensor_list()
Expand Down Expand Up @@ -314,10 +321,7 @@
if(SENSOR_COORDS)
to_chat(user_mob, span_notice("Your suit will now report your exact vital lifesigns as well as your coordinate position."))

if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.w_uniform == src)
H.update_suit_sensors()
update_wearer_status()

/obj/item/clothing/under/CtrlClick(mob/user)
. = ..()
Expand All @@ -328,6 +332,7 @@

sensor_mode = SENSOR_COORDS
balloon_alert(user, "set to tracking")
update_wearer_status()

/// Checks if the toggler is allowed to toggle suit sensors currently
/obj/item/clothing/under/proc/can_toggle_sensors(mob/toggler)
Expand Down

0 comments on commit 66880cc

Please sign in to comment.