Skip to content

Commit

Permalink
avoid panic, add current time when time can be casted to float
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm committed Sep 30, 2024
1 parent 692780d commit cb8094f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/src/godot_classes/animator_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ impl MultipleAnimationController {
self.current_time.remove(&anim.clip);
} else {
let time = self.base().get(anim_state.time_param_ref_str.clone());
self.current_time
.insert(anim.clip.clone(), time.to::<f32>());
if let Ok(time) = time.try_to::<f32>() {
self.current_time
.insert(anim.clip.clone(), time);
}
}

self.playing_anims.remove(&anim.clip);
Expand Down

0 comments on commit cb8094f

Please sign in to comment.