[MIRROR] Fix oversight allowing orbiting players to force the player they're orbitting to *surrender (#3474)

* Fix oversight allowing orbiting players to force the player they're orbitting to *surrender (#56972)

Observers with auto-observe inherit the HUD of the person they're observing. This includes Alerts. Alerts can be clicked. Alerts have varying levels of snowflaked checks. Some called parent and didn't check the return value. Some perform actions direct on usr instead of owner.

All of this has been standardised. Every single screen alert now calls ..() on Click() and returns early if the parent proc call returns false.

/atom/movable/screen/alert/Click now returns some useful value to children that call it.

* Fix oversight allowing orbiting players to force the player they're orbitting to *surrender

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2021-02-18 04:46:01 +00:00
committed by GitHub
co-authored by Timberpoes
parent be6eca62dd
commit 9e35706bc7
4 changed files with 100 additions and 54 deletions
+5 -4
View File
@@ -268,14 +268,15 @@
/atom/movable/screen/alert/status_effect/strandling/Click(location, control, params)
. = ..()
if(usr != owner)
if(!.)
return
to_chat(owner, "<span class='notice'>You attempt to remove the durathread strand from around your neck.</span>")
if(do_after(owner, 3.5 SECONDS, owner))
if(isliving(owner))
var/mob/living/L = owner
to_chat(owner, "<span class='notice'>You succesfuly remove the durathread strand.</span>")
L.remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND)
var/mob/living/living_owner = owner
to_chat(living_owner, "<span class='notice'>You succesfuly remove the durathread strand.</span>")
living_owner.remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND)
//OTHER DEBUFFS
/datum/status_effect/pacify
+3
View File
@@ -322,6 +322,9 @@
/atom/movable/screen/alert/status_effect/surrender/Click(location, control, params)
. = ..()
if(!.)
return
owner.emote("surrender")
/*
+6 -2
View File
@@ -114,8 +114,12 @@
desc = "Your body has sustained serious damage, click here to inspect yourself."
/atom/movable/screen/alert/status_effect/wound/Click()
var/mob/living/carbon/C = usr
C.check_self_for_injuries()
. = ..()
if(!.)
return
var/mob/living/carbon/carbon_owner = owner
carbon_owner.check_self_for_injuries()
// wound status effect base
/datum/status_effect/wound