mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user