Add checks to allow Tesla to fully dissipate once it runs out of energy.

This commit is contained in:
Leshana
2018-01-21 00:17:37 -05:00
parent b6a4531303
commit c8929d5bdb
+7 -1
View File
@@ -55,7 +55,8 @@
/obj/singularity/energy_ball/process(var/wait = 20)
set waitfor = FALSE
if(!orbiting)
handle_energy()
if (handle_energy())
return
move_the_basket_ball(max(wait - 5, 4 + orbiting_balls.len * 1.5))
@@ -91,6 +92,11 @@
sleep(1) // So movement is smooth
/obj/singularity/energy_ball/proc/handle_energy()
if (energy <= 0)
investigate_log("collapsed.", I_SINGULO)
qdel(src)
return TRUE
if(energy >= energy_to_raise)
energy_to_lower = energy_to_raise - 20
energy_to_raise = energy_to_raise * 1.25