This commit is contained in:
Eriks K 2021-02-03 21:01:37 +02:00
parent 14bcb46735
commit 4fe3efa045

View File

@ -2314,8 +2314,8 @@ class CitizenMilitary(CitizenTravel):
if source['type'] == 'pool': if source['type'] == 'pool':
_energy -= source['energy'] _energy -= source['energy']
elif source['type'] in ['food', 'energy_bar']: elif source['type'] in ['food', 'energy_bar']:
recovers = source['energy'] / source['amount'] recovers = source['energy'] // source['amount']
amount = recoverable // recovers amount = (recoverable if source['type'] == 'food' else _energy) // recovers
amount = amount if amount < source['amount'] else source['amount'] amount = amount if amount < source['amount'] else source['amount']
if amount > 0: if amount > 0:
energy_sources.update({f'energySources[{source_idx}][quality]': source['quality']}) energy_sources.update({f'energySources[{source_idx}][quality]': source['quality']})