From db0f9c7999e297bc75617341fe6358a46cdf8f2d Mon Sep 17 00:00:00 2001
From: Louis Capitanchik <contact@louiscap.co>
Date: Mon, 14 Nov 2022 18:39:47 +0000
Subject: [PATCH] Fix action animation overflow

---
 CHANGELOG.md | 5 +++++
 Cargo.toml   | 2 +-
 src/query.rs | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d0f824..1ef9b88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [0.2.1]
+
+### Fixed
+- Action animation frames overflow
+
 ## [0.2.0]
 
 ### Added
diff --git a/Cargo.toml b/Cargo.toml
index 8f78a35..0a4864c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "micro_banimate"
-version = "0.2.0"
+version = "0.2.1"
 edition = "2021"
 license = "Apache-2.0"
 description = "Easily manage complex Bevy 2D sprite animations"
diff --git a/src/query.rs b/src/query.rs
index b18d1ae..f9bce48 100644
--- a/src/query.rs
+++ b/src/query.rs
@@ -285,6 +285,7 @@ impl<'w, 's> AnimationQuery<'w, 's> {
 						entity,
 						user_data: status.user_data,
 					});
+					status.frame_step = current.frames.len() - 1;
 				}
 
 				if let Ok(mut sprite) = self.tile_sprite.get_mut(entity) {
-- 
GitLab