We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4328e2 commit 03b0f23Copy full SHA for 03b0f23
OgreMain/src/OgreAnimation.cpp
@@ -607,6 +607,10 @@ namespace Ogre {
607
if( timePos > totalAnimationLength && totalAnimationLength > 0.0f )
608
timePos = std::fmod( timePos, totalAnimationLength );
609
610
+ // Not best practice, but prevent from crash
611
+ if (mKeyFrameTimes.empty())
612
+ return timePos;
613
+
614
// Search for global index
615
auto it = std::lower_bound(mKeyFrameTimes.begin(), mKeyFrameTimes.end() - 1, timePos);
616
return TimeIndex(timePos, static_cast<uint>(std::distance(mKeyFrameTimes.begin(), it)));
0 commit comments