From a3790c983d8a46d346fec6d4c23e61b4aac4c26b Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 16 Sep 2020 14:53:29 -0400 Subject: [PATCH] CAnimTreeTransition: Handle negative transTimeRem (workaround) --- Runtime/Character/CAnimTreeTransition.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Runtime/Character/CAnimTreeTransition.cpp b/Runtime/Character/CAnimTreeTransition.cpp index 8e2c8dd17..5d5c107c2 100644 --- a/Runtime/Character/CAnimTreeTransition.cpp +++ b/Runtime/Character/CAnimTreeTransition.cpp @@ -121,9 +121,13 @@ SAdvancementResults CAnimTreeTransition::VAdvanceView(const CCharAnimTime& time) res = AdvanceViewForTransitionalPeriod(transTimeRem); if (res.x0_remTime != transTimeRem) return res; + + // NOTE: URDE can hit an infinite loop if transTimeRem + // becomes negative (floating point inaccuracy). + // This line was moved into this branch as a workaround. + res.x0_remTime = time - transTimeRem; } - res.x0_remTime = time - transTimeRem; return res; }