From e17f6de5a688aca221360f8dd4a257be78e114f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Sun, 11 Dec 2016 00:57:04 +0700 Subject: [PATCH] Attempt at fixing the crash in DoAnimation --- Source/Person.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Person.cpp b/Source/Person.cpp index a9b5983..acd6647 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -4181,6 +4181,9 @@ void Person::DoAnimations() oldrot = 0; targetrot = 0; } + if (frameCurrent >= Animation::animations[animCurrent].frames.size()) { + frameCurrent = Animation::animations[animCurrent].frames.size() - 1; + } if (animCurrent != oldanimCurrent || animTarget != oldanimTarget || ((frameCurrent != oldframeCurrent || frameTarget != oldframeTarget) && !calcrot)) { //Old rotates for (int i = 0; i < skeleton.joints.size(); i++) { @@ -4234,9 +4237,6 @@ void Person::DoAnimations() } } } - if (frameCurrent >= Animation::animations[animCurrent].frames.size()) { - frameCurrent = Animation::animations[animCurrent].frames.size() - 1; - } oldanimCurrent = animCurrent; oldanimTarget = animTarget; -- 2.39.5