Fix random A* target selection

There was try catch catching all Exceptions, now it's only catching IndexErrors
This commit is contained in:
Michał Czekański 2020-04-26 16:33:39 +02:00
parent dee9ebb77c
commit 31d2bf0009

View File

@ -97,7 +97,7 @@ class EventManager:
try: try:
self.game.movement.gotoToTarget(self.game.map.entities[Random().randint(0, len(self.game.map.entities))]) self.game.movement.gotoToTarget(self.game.map.entities[Random().randint(0, len(self.game.map.entities))])
break break
except Exception: except IndexError:
pass pass