diff --git a/Source/engine/animationinfo.cpp b/Source/engine/animationinfo.cpp index ea43ec94e..463825d7e 100644 --- a/Source/engine/animationinfo.cpp +++ b/Source/engine/animationinfo.cpp @@ -59,17 +59,17 @@ int AnimationInfo::GetFrameToUseForRendering() const float AnimationInfo::GetAnimationProgress() const { - int ticksSinceSequenceStarted = TicksSinceSequenceStarted; + float ticksSinceSequenceStarted = TicksSinceSequenceStarted; float tickModifier = TickModifier; if (RelevantFramesForDistributing <= 0) { // This logic is used if animation distribution is not active (see GetFrameToUseForRendering). // In this case the variables calculated with animation distribution are not initialized and we have to calculate them on the fly with the given information. - ticksSinceSequenceStarted = ((CurrentFrame - 1) * TicksPerFrame) + TickCounterOfCurrentFrame; + ticksSinceSequenceStarted = static_cast(((CurrentFrame - 1) * TicksPerFrame) + TickCounterOfCurrentFrame); tickModifier = 1.0F / static_cast(TicksPerFrame); } - float totalTicksForCurrentAnimationSequence = GetProgressToNextGameTick() + static_cast(ticksSinceSequenceStarted); + float totalTicksForCurrentAnimationSequence = GetProgressToNextGameTick() + ticksSinceSequenceStarted; float progressInAnimationFrames = totalTicksForCurrentAnimationSequence * tickModifier; float animationFraction = progressInAnimationFrames / static_cast(NumberOfFrames); return animationFraction; diff --git a/Source/player.cpp b/Source/player.cpp index ea8fb580a..dfe62943e 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2409,7 +2409,7 @@ void NewPlrAnim(Player &player, player_graphic graphic, Direction dir, int numbe CelSprite *pCelSprite = celSprite ? &*celSprite : nullptr; float previewShownGameTickFragments = 0.F; - if (pCelSprite == player.pPreviewCelSprite) + if (pCelSprite == player.pPreviewCelSprite && !player.IsWalking()) previewShownGameTickFragments = clamp(1.F - player.progressToNextGameTickWhenPreviewWasSet, 0.F, 1.F); player.AnimInfo.SetNewAnimation(pCelSprite, numberOfFrames, delayLen, flags, numSkippedFrames, distributeFramesBeforeFrame, previewShownGameTickFragments); }