From 025e76b8bdc4d751832920b266108fb0b7ce1596 Mon Sep 17 00:00:00 2001 From: Corwin Date: Wed, 30 Aug 2023 00:55:25 +0100 Subject: [PATCH] you can only turn around if this is your first movement --- .../src/game/simulation/entity.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs index de128708..d4ef4f48 100644 --- a/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs +++ b/examples/the-dungeon-puzzlers-lament/src/game/simulation/entity.rs @@ -418,6 +418,8 @@ impl EntityMap { }) .collect::>(); + let mut first_loop = true; + while !entities_to_try_update.is_empty() { let mut entities_that_have_moved = Vec::new(); @@ -427,7 +429,7 @@ impl EntityMap { &mut animations, entity_to_update_key, direction, - true, + first_loop, self.map .get(entity_to_update_key) .and_then(|e| e.push_depth()) @@ -450,6 +452,8 @@ impl EntityMap { hero_has_died |= action_result.hero_has_died; win_has_triggered |= action_result.win_has_triggered; } + + first_loop = false; } (