From 653233597f4e04742cbfeeb10abf499d59473550 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 20 Feb 2021 17:09:04 +0100 Subject: [PATCH] [MIRROR] Fixes restraint alerts doing nothing when clicked. (#3534) * Fixes restraint alerts doing nothing when clicked. (#57034) * Fixes restraint alerts doing nothing when clicked. Co-authored-by: Timberpoes --- code/_onclick/hud/alert.dm | 11 ++++++++--- code/game/objects/buckling.dm | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 58f94a88569..4c9d2f24261 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -98,6 +98,9 @@ var/override_alerts = FALSE //If it is overriding other alerts of the same type var/mob/owner //Alert owner + /// Boolean. If TRUE, the Click() proc will attempt to Click() on the master first if there is a master. + var/click_master = TRUE + /atom/movable/screen/alert/MouseEntered(location,control,params) if(!QDELETED(src)) @@ -660,7 +663,7 @@ so as to remain in compliance with the most up-to-date laws." //OBJECT-BASED -/atom/movable/screen/alert/restrained/buckled +/atom/movable/screen/alert/buckled name = "Buckled" desc = "You've been buckled to something. Click the alert to unbuckle unless you're handcuffed." icon_state = "buckled" @@ -668,10 +671,12 @@ so as to remain in compliance with the most up-to-date laws." /atom/movable/screen/alert/restrained/handcuffed name = "Handcuffed" desc = "You're handcuffed and can't act. If anyone drags you, you won't be able to move. Click the alert to free yourself." + click_master = FALSE /atom/movable/screen/alert/restrained/legcuffed name = "Legcuffed" desc = "You're legcuffed, which slows you down considerably. Click the alert to free yourself." + click_master = FALSE /atom/movable/screen/alert/restrained/Click() . = ..() @@ -687,7 +692,7 @@ so as to remain in compliance with the most up-to-date laws." if((living_owner.mobility_flags & MOBILITY_MOVE) && (living_owner.last_special <= world.time)) return living_owner.resist_restraints() -/atom/movable/screen/alert/restrained/buckled/Click() +/atom/movable/screen/alert/buckled/Click() . = ..() if(!.) return @@ -768,7 +773,7 @@ so as to remain in compliance with the most up-to-date laws." if(LAZYACCESS(modifiers, SHIFT_CLICK)) // screen objects don't do the normal Click() stuff so we'll cheat to_chat(usr, "[name] - [desc]") return FALSE - if(master) + if(master && click_master) return usr.client.Click(master, location, control, params) return TRUE diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 55f54f8f7ab..25d156ac5b4 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -115,7 +115,7 @@ M.set_buckled(src) M.setDir(dir) buckled_mobs |= M - M.throw_alert("buckled", /atom/movable/screen/alert/restrained/buckled) + M.throw_alert("buckled", /atom/movable/screen/alert/buckled) M.set_glide_size(glide_size) post_buckle_mob(M)