Fix end-of-animation index OOB (#6210)

# Objective

Fixes #6204

## Solution

Added another branch to handle end-of-animation special case
This commit is contained in:
thebluefish 2022-10-17 16:42:34 +00:00
parent b09b2c1056
commit c6e0da4bcb

View File

@ -243,6 +243,7 @@ pub fn animation_player(
.keyframe_timestamps
.binary_search_by(|probe| probe.partial_cmp(&elapsed).unwrap())
{
Ok(n) if n >= curve.keyframe_timestamps.len() - 1 => continue, // this curve is finished
Ok(i) => i,
Err(0) => continue, // this curve isn't started yet
Err(n) if n > curve.keyframe_timestamps.len() - 1 => continue, // this curve is finished