From 911b93bd0f3660f0b5adabcfd192115daee1e76e Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Tue, 14 Jan 2025 23:18:24 +0200 Subject: [PATCH] CAnimBlendNode::GetCurrentTranslation: Protect against zero delta times --- src/animation/AnimBlendNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/animation/AnimBlendNode.cpp b/src/animation/AnimBlendNode.cpp index 8c3a6bc7..1392bed4 100644 --- a/src/animation/AnimBlendNode.cpp +++ b/src/animation/AnimBlendNode.cpp @@ -140,7 +140,7 @@ CAnimBlendNode::GetCurrentTranslation(CVector &trans, float weight) float blend = association->GetBlendAmount(weight); if(blend > 0.0f){ auto kfAdt = sequence->GetDeltaTime(frameA); - float t = (kfAdt - remainingTime)/kfAdt; + float t = kfAdt == 0.0f ? 0.0f : (kfAdt - remainingTime)/kfAdt; if(sequence->type & CAnimBlendSequence::KF_TRANS){ auto kfAt = sequence->GetTranslation(frameA); auto kfBt = sequence->GetTranslation(frameB);