From e982811f4d06c97aa3d3477428e6f49f15c321ed Mon Sep 17 00:00:00 2001 From: py01 Date: Mon, 22 Apr 2019 21:35:19 -0600 Subject: [PATCH] Fix mech exiting with resist (#43658) Adds delay to resist exit. --- code/game/mecha/mecha.dm | 10 ++++++++-- code/game/mecha/mecha_actions.dm | 10 +--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d2767f9f8a6..f1cbbc01240 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -979,8 +979,14 @@ return TRUE /obj/mecha/container_resist(mob/living/user) - go_out() - + is_currently_ejecting = TRUE + to_chat(occupant, "You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.") + if(do_after(occupant,exit_delay, target = src)) + to_chat(occupant, "You exit the mech.") + go_out() + else + to_chat(occupant, "You stop exiting the mech. Weapons are enabled again.") + is_currently_ejecting = FALSE /obj/mecha/Exited(atom/movable/M, atom/newloc) if(occupant && occupant == M) // The occupant exited the mech without calling go_out() diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index a638f484932..30d5b8266fa 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -44,15 +44,7 @@ return if(!chassis || chassis.occupant != owner) return - chassis.is_currently_ejecting = TRUE - to_chat(owner, "You begin the ejection procedure. Equipment is disabled during this process. Hold still to finish ejecting.") - if(do_after(chassis.occupant,chassis.exit_delay, target = chassis)) - to_chat(owner, "You exit the mech.") - chassis.go_out() - else - to_chat(owner, "You stop exiting the mech. Weapons are enabled again.") - chassis.is_currently_ejecting = FALSE - + chassis.container_resist(chassis.occupant) /datum/action/innate/mecha/mech_toggle_internals name = "Toggle Internal Airtank Usage"