From be4c98b6c874a16716440005be44bfda50ee64b6 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Sun, 31 Jan 2016 11:43:18 +0100 Subject: [PATCH] The mecha do_after_cooldown() no longer quits early. Fixes #12080. --- code/game/mecha/equipment/mecha_equipment.dm | 11 ++++----- code/game/mecha/equipment/tools/tools.dm | 26 ++++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index c9974cb76df..b55419d8619 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -17,12 +17,11 @@ /obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(target=1) - spawn(equip_cooldown) - set_ready_state(1) - if(target && chassis) - return 1 - return 0 - + sleep(equip_cooldown) + set_ready_state(1) + if(target && chassis) + return 1 + return 0 /obj/item/mecha_parts/mecha_equipment/New() ..() diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index befd1247a20..6a3decc5cf5 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -83,8 +83,8 @@ if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return set_ready_state(0) chassis.use_power(energy_drain) - chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") - occupant_message("You start to drill [target]") + chassis.visible_message("\The [chassis] starts to drill \the [target]", "You hear a large drill.") + occupant_message("You start to drill \the [target]") var/T = chassis.loc var/C = target.loc //why are these backwards? we may never know -Pete if(do_after_cooldown(target)) @@ -92,15 +92,15 @@ if(istype(target, /turf/simulated/wall)) var/turf/simulated/wall/W = target if(W.reinf_material) - occupant_message("[target] is too durable to drill through.") + occupant_message("\The [target] is too durable to drill through.") else - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") target.ex_act(2) else if(istype(target, /turf/simulated/mineral)) for(var/turf/simulated/mineral/M in range(chassis,1)) if(get_dir(chassis,M)&chassis.dir) M.GetDrilled() - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) @@ -111,7 +111,7 @@ for(var/turf/simulated/floor/asteroid/M in range(chassis,1)) if(get_dir(chassis,M)&chassis.dir) M.gets_dug() - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) @@ -119,7 +119,7 @@ if(get_dir(chassis,ore)&chassis.dir) ore.Move(ore_box) else if(target.loc == C) - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") target.ex_act(2) return 1 @@ -138,8 +138,8 @@ if(target_obj.unacidable) return set_ready_state(0) chassis.use_power(energy_drain) - chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") - occupant_message("You start to drill [target]") + chassis.visible_message("\The [chassis] starts to drill \the [target]", "You hear a large drill.") + occupant_message("You start to drill \the [target]") var/T = chassis.loc var/C = target.loc //why are these backwards? we may never know -Pete if(do_after_cooldown(target)) @@ -147,13 +147,13 @@ if(istype(target, /turf/simulated/wall)) var/turf/simulated/wall/W = target if(!W.reinf_material || do_after_cooldown(target))//To slow down how fast mechs can drill through the station - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") target.ex_act(3) else if(istype(target, /turf/simulated/mineral)) for(var/turf/simulated/mineral/M in range(chassis,1)) if(get_dir(chassis,M)&chassis.dir) M.GetDrilled() - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) @@ -163,14 +163,14 @@ else if(istype(target,/turf/simulated/floor/asteroid)) for(var/turf/simulated/floor/asteroid/M in range(target,1)) M.gets_dug() - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment) var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo if(ore_box) for(var/obj/item/weapon/ore/ore in range(target,1)) ore.Move(ore_box) else if(target.loc == C) - log_message("Drilled through [target]") + log_message("Drilled through \the [target]") target.ex_act(2) return 1