Fixes emitter pulsing firing beams without actually needing energy (#23774)

* Update emitter.dm

* Update emitter.dm

* Update emitter.dm
This commit is contained in:
kevinz000
2017-02-08 18:28:14 +13:00
committed by oranges
parent a6f028c38f
commit 5f7d6844fa
2 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -9,5 +9,5 @@
/datum/wires/emitter/on_pulse(wire)
var/obj/machinery/power/emitter/E = holder
E.fire_beam()
E.fire_beam_pulse()
..()
+10 -1
View File
@@ -168,6 +168,8 @@
investigate_log("lost power and turned <font color='red'>off</font>","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