From e3350de3a2d90922c2b16e5b5e819f259adb3588 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Fri, 5 Mar 2021 18:00:29 +0100 Subject: augs, armor and brain stats tweak, scroll stats view --- gst/units.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gst/units.c') diff --git a/gst/units.c b/gst/units.c index b5d05a9..aeced1b 100644 --- a/gst/units.c +++ b/gst/units.c @@ -244,7 +244,10 @@ void army_upkeep (infos *info, army *ar, map *m, stats_unit *ustats) { for (int i=0; iuslen; i++) { unit *u = ar->us+i; if (u->hp <= 0) continue; - u->charge -= ustats[i].frame.upkeep; + float dcharge = -ustats[i].frame.upkeep; + // if delta charge >0, see if the battery can be recharged + if (dcharge > 0) dcharge *= ustats[i].frame.recharge; + u->charge += dcharge; if (u->charge < 0) u->charge = 0; } } \ No newline at end of file -- cgit v1.2.3-54-g00ecf