Skip to content

Commit 0acda66

Browse files
committed
fix issues in anim blending
1 parent c02aaec commit 0acda66

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,11 +2391,12 @@ void W3DModelDraw::adjustAnimation(const ModelConditionInfo* prevState, Real pre
23912391
isCommonMaintainFrameFlagSet(m_curState->m_flags, prevState->m_flags) &&
23922392
prevAnimFraction >= 0.0)
23932393
{
2394-
startFrame = REAL_TO_INT(prevAnimFraction * animHandle->Get_Num_Frames()-1);
2394+
startFrame = REAL_TO_INT(prevAnimFraction * (animHandle->Get_Num_Frames()-1));
23952395
}
23962396

23972397
// ANIMATION BLENDING
23982398
if (prevState &&
2399+
m_whichAnimInPrevState >= 0 &&
23992400
m_curState->m_animBlendTime > 0) {
24002401

24012402
const W3DAnimationInfo& animInfoPrev = prevState->m_animations[m_whichAnimInPrevState];
@@ -2409,7 +2410,7 @@ void W3DModelDraw::adjustAnimation(const ModelConditionInfo* prevState, Real pre
24092410

24102411
Real factor = GameClientRandomValueReal(m_curState->m_animMinSpeedFactor, m_curState->m_animMaxSpeedFactor);
24112412

2412-
Int startFramePrev = REAL_TO_INT(prevAnimFraction * m_prevAnimHelper.numFrames - 1);
2413+
Int startFramePrev = REAL_TO_INT(m_prevAnimHelper.frameNum);
24132414

24142415
// maxBlendTime = currentAnim duration in milliseconds
24152416
Int animBlendTime = m_curState->m_animBlendTime;

0 commit comments

Comments
 (0)