diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..fad2cd984302b66e321af8890958fe756a1e1a5c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog +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.1.1] + +### Fixed +- "play once and then" animations could overflow frame array bounds \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 004220814d36ea27d8be9a6bb85bdee6865f7cdf..fb2ba21b9b121315f00cb9d4c9b0d7156754173a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "micro_banimate" -version = "0.1.0" +version = "0.1.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 a1d949b65b15a4d121d63decb95f435a00f1f127..5bf29856d980466926c04c82f59f6a39fb82d32a 100644 --- a/src/query.rs +++ b/src/query.rs @@ -265,7 +265,7 @@ impl<'w, 's> AnimationQuery<'w, 's> { None => continue, }; - let current = match sheet.get(&status.active_name) { + let mut current = match sheet.get(&status.active_name) { Some(set) => set, None => continue, }; @@ -288,6 +288,12 @@ impl<'w, 's> AnimationQuery<'w, 's> { *mode = AnimationMode::Loop; status.active_name = next.clone(); status.frame_time = 0.0; + status.active_step = 0; + + current = match sheet.get(&status.active_name) { + Some(set) => set, + None => continue, + }; } }