From dee9ebb77c28c885443a1bd171a58772094849b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czeka=C5=84ski?= Date: Sun, 26 Apr 2020 16:04:47 +0200 Subject: [PATCH] Fix not stepping on final entity --- src/AI/AutomaticMovement.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/AI/AutomaticMovement.py b/src/AI/AutomaticMovement.py index 0b443f0..3ab41b2 100644 --- a/src/AI/AutomaticMovement.py +++ b/src/AI/AutomaticMovement.py @@ -69,12 +69,8 @@ class AutomaticMovement: if self.goalTest(elem.state): movesList = [] - coordsWithUiOffset = [elem.state[0] + self.leftUiWidth, elem.state[0]] - if self.map.collision(coordsWithUiOffset[0], coordsWithUiOffset[1]): # If goal was some entity - omit one forward movement, because player shouldn't step on entity. + if isinstance(self.actualTarget, Entity): elem = elem.parent - else: # debug - a = 1 - a += 1 while elem.action is not None: movesList.append(elem.action)