Merge branch 'skmp/protect-from-zero-delta-times' into 'main'

CAnimBlendNode::GetCurrentTranslation: Protect against zero delta times

See merge request skmp/dca3-game!15
This commit is contained in:
Stefanos Kornilios Mitsis Poiitidis 2025-01-16 06:13:03 +00:00
commit 33b9dd1c8a

View File

@ -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);