diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index cbdc07d7ad..122a89842f 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -436,13 +436,18 @@ var/list/mob_hat_cache = list() set name = "Transmit Power" if(!power) power=250 + if(power<=0 || power>=cell.maxcharge || power>=cell.charge) return //Safeties to not kill ourselves, also safeties to not use this to drain. + actpower(power) + return if(power<=0 || power>=cell.maxcharge || power>=cell.charge) return //Safeties to not kill ourselves, also safeties to not use this to drain. + actpower(power) + return +/mob/living/silicon/robot/drone/proc/actpower(var/power) for(var/obj/item/weapon/cell/remotecell in range(1, src)) //assuming 1 = 1 tile next to us, if this works will lower to 0 + src << "Trying to transfer power to a cell.." if(power>=cell.charge) return //rechecking our initial safety so if we mass charge we dont die. var/newcharge = remotecell.charge + power //What the battery is at after charge if(newcharge<=remotecell.maxcharge) //Making sure we arent wasting power remotecell.give(power) //give is a proc native to cells that increases charge and updates the iconstate if needed cell.give(-power)//TO BE TESTED, no idea if negative give works, once i've tested this i'll add this as a verb-shark else return - -