Explorar o código

fix bug where non-existing frame could be specified

Edward Rudd %!s(int64=13) %!d(string=hai) anos
pai
achega
82ed3af661
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      CatapultNetWars/Catapult/Catapult.cs

+ 1 - 1
CatapultNetWars/Catapult/Catapult.cs

@@ -446,7 +446,7 @@ namespace CatapultGame
             var aimAnimation = animations["Aim"];
             int frameToDisplay =
                 Convert.ToInt32(aimAnimation.FrameCount * ShotStrength);
-            aimAnimation.FrameIndex = frameToDisplay;
+            aimAnimation.FrameIndex = Math.Min(aimAnimation.FrameCount, frameToDisplay);
         }
 
         /// <summary>