Fixing a bug in the cyborg taser that caused it to continue draining cell-power from the cyborg even after it had finished recharging.

This commit is contained in:
jack-fractal
2013-09-11 23:33:23 -04:00
parent ee156376a3
commit e73c06e51c

View File

@@ -33,14 +33,16 @@
charge_tick++
if(charge_tick < recharge_time) return 0
charge_tick = 0
if(!power_supply) return 0 //sanity
if(power_supply.charge >= power_supply.maxcharge) return 0 // check if we actually need to recharge
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
if(R && R.cell)
R.cell.use(charge_cost) //Take power from the borg...
power_supply.give(charge_cost) //... to recharge the shot
update_icon()
return 1