From a9bc78b70116e9a3389068e5a22086bfd9bcb6ec Mon Sep 17 00:00:00 2001 From: Eriks K Date: Fri, 11 Dec 2020 17:22:45 +0200 Subject: [PATCH] Sleep accepts floats and decimals, not only integers. Bomb deploy should use Citizen.sleep instead of utils.sleep --- erepublik/citizen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erepublik/citizen.py b/erepublik/citizen.py index 43ea923..c29494c 100644 --- a/erepublik/citizen.py +++ b/erepublik/citizen.py @@ -417,7 +417,7 @@ class BaseCitizen(access_points.CitizenAPI): else: utils.process_error(msg, self.name, sys.exc_info(), self, None, None) - def sleep(self, seconds: int): + def sleep(self, seconds: Union[int, float, Decimal]): if seconds < 0: seconds = 0 if self.config.interactive: @@ -1922,8 +1922,9 @@ class CitizenMilitary(CitizenTravel): r = self._post_military_deploy_bomb(battle.id, division.id, side.id, bomb_id).json() if not r.get('error'): deployed_count += 1 + self.sleep(0.5) elif r.get('message') == 'LOCKED': - sleep(0.5) + self.sleep(0.5) else: errors += 1