Fix going to target in goToTarget method

Disabled trying to retrieve moves from empty movement list.
This commit is contained in:
Michał Czekański 2020-04-26 14:12:54 +02:00
parent d5c9f5f801
commit ab1b4e9efc

View File

@ -28,7 +28,8 @@ class AutomaticMovement:
self.targetCoords = (self.actualTarget.rect.x - self.leftUiWidth, self.actualTarget.rect.y) self.targetCoords = (self.actualTarget.rect.x - self.leftUiWidth, self.actualTarget.rect.y)
self.movesList = self.a_Star() self.movesList = self.a_Star()
if self.movesList is not None: if self.movesList is not None:
self.nextMove = self.movesList[0] if len(self.movesList) > 0:
self.nextMove = self.movesList[0]
else: else:
self.actualTarget = None self.actualTarget = None