you can only turn around if this is your first movement

This commit is contained in:
Corwin 2023-08-30 00:55:25 +01:00
parent c142184bc0
commit 025e76b8bd
No known key found for this signature in database

View file

@ -418,6 +418,8 @@ impl EntityMap {
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let mut first_loop = true;
while !entities_to_try_update.is_empty() { while !entities_to_try_update.is_empty() {
let mut entities_that_have_moved = Vec::new(); let mut entities_that_have_moved = Vec::new();
@ -427,7 +429,7 @@ impl EntityMap {
&mut animations, &mut animations,
entity_to_update_key, entity_to_update_key,
direction, direction,
true, first_loop,
self.map self.map
.get(entity_to_update_key) .get(entity_to_update_key)
.and_then(|e| e.push_depth()) .and_then(|e| e.push_depth())
@ -450,6 +452,8 @@ impl EntityMap {
hero_has_died |= action_result.hero_has_died; hero_has_died |= action_result.hero_has_died;
win_has_triggered |= action_result.win_has_triggered; win_has_triggered |= action_result.win_has_triggered;
} }
first_loop = false;
} }
( (