avoid bots taking over the server

This commit is contained in:
Alberto Xamin 2021-06-07 21:47:12 +02:00
parent 5f8b23e8f4
commit 7ff3895433
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -228,7 +228,7 @@ class Player:
def bot_spin(self): def bot_spin(self):
while self.is_bot and self.game != None and not self.game.shutting_down: while self.is_bot and self.game != None and not self.game.shutting_down:
eventlet.sleep(uniform(self.game.bot_speed/2-0.1, self.game.bot_speed)) eventlet.sleep(min(0.2, uniform(self.game.bot_speed/2-0.1, self.game.bot_speed)))
if self.lives > 0 or self.is_ghost: if self.lives > 0 or self.is_ghost:
self.bot_logic() self.bot_logic()