Also improves apc/process() (doesnt add and then remove charge from
cells when it doesn't have to).
This commit is contained in:
mwerezak
2014-08-10 00:36:40 -04:00
parent 3be94d47c1
commit 4b070a2de6
10 changed files with 83 additions and 84 deletions

View File

@@ -107,8 +107,7 @@
return
if(((src.last_shot + src.fire_delay) <= world.time) && (src.active == 1))
if(!active_power_usage || avail(active_power_usage))
add_load(active_power_usage)
if(surplus() >= active_power_usage && add_load(active_power_usage) >= active_power_usage) //does the laser have enough power to shoot?
if(!powered)
powered = 1
update_icon()