From 6abc283686372d3ea0edcb1c439376321a78496f Mon Sep 17 00:00:00 2001 From: DylanVsn <43576618+DylanVsn@users.noreply.github.com> Date: Mon, 9 Dec 2019 16:26:54 +0100 Subject: [PATCH] =?UTF-8?q?normalement=20plus=20de=20bug=20fant=C3=B4me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/game_objects/ghost.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scenes/game_objects/ghost.py b/scenes/game_objects/ghost.py index 5b96f7b..fea0e62 100644 --- a/scenes/game_objects/ghost.py +++ b/scenes/game_objects/ghost.py @@ -104,6 +104,9 @@ class Ghost(Entity): graph = SceneManager().scene.entities['level'].graph cur_node = graph[self.y//S][self.x//S] children = cur_node.children + child_ok = list(filter(lambda c: c[0] == final_node, children)) + if child_ok: + return [child_ok[0]] trace = [cur_node] + [x[0] for x in children] paths = [[x] for x in children] while 1: