From 616e252ae300825df83f52bf143ce9286501a34d Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 25 Jan 2024 21:22:53 -0800 Subject: [PATCH] Minor edit --- crates/content/src/spriteautomaton.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/content/src/spriteautomaton.rs b/crates/content/src/spriteautomaton.rs index 17a7ea2..87cbf82 100644 --- a/crates/content/src/spriteautomaton.rs +++ b/crates/content/src/spriteautomaton.rs @@ -126,7 +126,12 @@ impl SpriteAutomaton { fn take_edge(&mut self, ct: &Content, e: SectionEdge) { let sprite = ct.get_sprite(self.sprite); let current_section = sprite.get_section(self.current_section); - let last_direction = self.current_direction; + + let last = match self.current_direction { + AnimDirection::Stop => self.next_texture, + AnimDirection::Down => self.next_texture, + AnimDirection::Up => self.last_texture, + }; match e { SectionEdge::Stop => { @@ -198,12 +203,6 @@ impl SpriteAutomaton { } } - let last = match last_direction { - AnimDirection::Stop => self.last_texture, - AnimDirection::Down => self.next_texture, - AnimDirection::Up => self.last_texture, - }; - match self.current_direction { AnimDirection::Stop => { let current_section = sprite.get_section(self.current_section);