From 3eae35833c28eb6da41eaca049ac2dc0fbfe2332 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:47:54 +0100 Subject: [PATCH] [MIRROR] Fixes telekinesis breaking chameleon. [MDB IGNORE] (#12141) * Fixes unarmed telekinesis breaking chameleon. (#65505) Apparently whoever implemented the signal handler forgot to pass the signal source so it was reading the thing clicked on as whether the thing clicked on was adjacent. As datums are truthy this resulted in all clicks breaking chameleon. * Fixes telekinesis breaking chameleon. Co-authored-by: TemporalOroboros --- code/datums/mutations/chameleon.dm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/code/datums/mutations/chameleon.dm b/code/datums/mutations/chameleon.dm index 0d8e39656ab..8cd42b8f0b8 100644 --- a/code/datums/mutations/chameleon.dm +++ b/code/datums/mutations/chameleon.dm @@ -29,7 +29,17 @@ owner.alpha = max(owner.alpha - (12.5 * delta_time), 0) /// SKYRAT EDIT END -/datum/mutation/human/chameleon/proc/on_move() +/** + * Resets the alpha of the host to the chameleon default if they move. + * + * Arguments: + * - [source][/atom/movable]: The source of the signal. Presumably the host mob. + * - [old_loc][/atom]: The location the host mob used to be in. + * - move_dir: The direction the host mob moved in. + * - forced: Whether the movement was caused by a forceMove or moveToNullspace. + * - [old_locs][/list/atom]: The locations the host mob used to be in. + */ +/datum/mutation/human/chameleon/proc/on_move(atom/movable/source, atom/old_loc, move_dir, forced, list/atom/old_locs) SIGNAL_HANDLER /// SKYRAT EDIT BEGIN @@ -39,7 +49,16 @@ owner.alpha = 255 /// SKYRAT EDIT END -/datum/mutation/human/chameleon/proc/on_attack_hand(atom/target, proximity) +/** + * Resets the alpha of the host if they click on something nearby. + * + * Arguments: + * - [source][/mob/living/carbon/human]: The host mob that just clicked on something. + * - [target][/atom]: The thing the host mob clicked on. + * - proximity: Whether the host mob can physically reach the thing that they clicked on. + * - [modifiers][/list]: The set of click modifiers associated with this attack chain call. + */ +/datum/mutation/human/chameleon/proc/on_attack_hand(mob/living/carbon/human/source, atom/target, proximity, list/modifiers) SIGNAL_HANDLER if(!proximity) //stops tk from breaking chameleon