Fix human charging

This commit is contained in:
Aronai Sieyes
2020-04-24 12:38:45 -04:00
parent b1b8429df0
commit b3d1a103ac
@@ -242,6 +242,7 @@
charge_guns = TRUE
// A 'human stand-in' cell for recharging 'nutrition' on synthetic humans (wow this is terrible! \o/)
#define NUTRITION_COEFF 0.05 // 1000 charge = 50 nutrition at 0.05
/obj/item/weapon/cell/standin
name = "don't spawn this"
desc = "this is for weird code use, don't spawn it!!!"
@@ -259,12 +260,14 @@
QDEL_IN(src, 20 SECONDS)
/obj/item/weapon/cell/standin/give(var/amount)
amount *= 0.05 // So 1000 becomes 50
..(amount)
hume.nutrition += amount
. = ..(amount * NUTRITION_COEFF) //Shrink amount to store
hume.nutrition += . //Add the amount we really stored
. /= NUTRITION_COEFF //Inflate amount to take from the giver
// Various sideways-defined get_cells
/obj/mecha/get_cell()
return cell
#undef NUTRITION_COEFF