From 9b204ff733a43660b49009f28aefcf4ab3e49cb1 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 7 Nov 2020 01:33:06 +0100 Subject: [PATCH] [MIRROR] You can now unbuckle others from the toolbox training machine with altclick. (#1593) * Merge pull request #54798 from Ghommie/Ghommie-tg38 You can now unbuckle others from the toolbox training machine with altclick. (Lemon: Cleans up some issues with remote toolbox removal too) * You can now unbuckle others from the toolbox training machine with altclick. Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> --- .../objects/structures/training_machine.dm | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/code/game/objects/structures/training_machine.dm b/code/game/objects/structures/training_machine.dm index 294e108e2b3..b7f3e204c42 100644 --- a/code/game/objects/structures/training_machine.dm +++ b/code/game/objects/structures/training_machine.dm @@ -9,7 +9,7 @@ /** * Machine that runs around wildly so people can practice clickin on things * - * Can have a mob buckled on or a obj/item/target attached. Movement controlled by SSFastProcess, + * Can have a mob buckled on or a obj/item/target attached. Movement controlled by SSFastProcess, * movespeed controlled by cooldown macros. Can attach obj/item/target, obj/item/training_toolbox, and can buckle mobs to this. */ /obj/structure/training_machine @@ -74,7 +74,7 @@ return data /** - * Control the attached variables. + * Control the attached variables. * * Will not respond if moving and emagged, so once you set it to go it can't be stopped! */ @@ -174,6 +174,11 @@ /obj/structure/training_machine/AltClick(mob/user) . = ..() + if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, NO_TK, FLOOR_OKAY)) + return + if(has_buckled_mobs()) + user_unbuckle_mob(buckled_mobs[1], user) + return if (!attached_item) return if (obj_flags & EMAGGED) @@ -184,7 +189,7 @@ playsound(src, "rustle", 50, TRUE) /** - * Toggle the machine's movement + * Toggle the machine's movement */ /obj/structure/training_machine/proc/toggle() if (moving) @@ -221,8 +226,8 @@ /** * Main movement method for the machine * - * Handles movement using SSFastProcess. Moves randomly, point-to-point, in an area centered around wherever it started. - * Will only move if the move_cooldown cooldown macro is finished. + * Handles movement using SSFastProcess. Moves randomly, point-to-point, in an area centered around wherever it started. + * Will only move if the move_cooldown cooldown macro is finished. * If it can't find a place to go, it will stop moving. */ /obj/structure/training_machine/process() @@ -320,9 +325,12 @@ /obj/structure/training_machine/examine(mob/user) . = ..() + var/has_buckled_mob = has_buckled_mobs() + if(has_buckled_mob) + . += "Alt-Click to unbuckle \the [buckled_mobs[1]]" if (obj_flags & EMAGGED) . += "It has a dangerous-looking toolbox attached to it, and the control panel is smoking sightly..." - else if (attached_item) //Can't removed the syndicate toolbox! + else if (!has_buckled_mob && attached_item) //Can't removed the syndicate toolbox! . += "Alt-Click to remove \the [attached_item]" . += "Click to open control interface."