Browse Source

Bugfix: AnimationInfo integer division by 0

pull/5627/head
KPhoenix 3 years ago committed by Gleb Mazovetskiy
parent
commit
75d785a5f0
  1. 6
      Source/engine/animationinfo.cpp

6
Source/engine/animationinfo.cpp

@ -162,7 +162,11 @@ void AnimationInfo::setNewAnimation(OptionalClxSpriteList celSprite, int8_t numb
relevantAnimationTicksWithSkipping += previewShownGameTickFragments;
// if we skipped Frames we need to expand the game ticks to make one game tick for this Animation "faster"
int32_t tickModifier = baseValueFraction * relevantAnimationTicksForDistribution / relevantAnimationTicksWithSkipping;
int32_t tickModifier;
if (relevantAnimationTicksWithSkipping != 0)
tickModifier = baseValueFraction * relevantAnimationTicksForDistribution / relevantAnimationTicksWithSkipping;
else
tickModifier = 0;
// tickModifier specifies the Animation fraction per game tick, so we have to remove the delay from the variable
tickModifier /= ticksPerFrame;

Loading…
Cancel
Save