From 5f7d6844fa2d12af5569f4c920c1c76bfeb97757 Mon Sep 17 00:00:00 2001 From: kevinz000 Date: Tue, 7 Feb 2017 21:28:14 -0800 Subject: [PATCH] Fixes emitter pulsing firing beams without actually needing energy (#23774) * Update emitter.dm * Update emitter.dm * Update emitter.dm --- code/datums/wires/emitter.dm | 2 +- code/modules/power/singularity/emitter.dm | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/datums/wires/emitter.dm b/code/datums/wires/emitter.dm index e58b3a5e095..df1cf05a9c8 100644 --- a/code/datums/wires/emitter.dm +++ b/code/datums/wires/emitter.dm @@ -9,5 +9,5 @@ /datum/wires/emitter/on_pulse(wire) var/obj/machinery/power/emitter/E = holder - E.fire_beam() + E.fire_beam_pulse() ..() diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 242d64c5a14..efa688e8880 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -168,6 +168,8 @@ investigate_log("lost power and turned off","singulo") log_game("Emitter lost power in ([x],[y],[z])") return + if(!check_delay()) + return FALSE fire_beam() /obj/machinery/power/emitter/proc/check_delay() @@ -175,9 +177,16 @@ return TRUE return FALSE -/obj/machinery/power/emitter/proc/fire_beam() +/obj/machinery/power/emitter/proc/fire_beam_pulse() if(!check_delay()) return FALSE + if(state != 2) + return FALSE + if(avail(active_power_usage)) + add_load(active_power_usage) + fire_beam() + +/obj/machinery/power/emitter/proc/fire_beam() src.last_shot = world.time if(src.shot_number < 3) src.fire_delay = 20