浏览代码

fix bug where non-existing frame could be specified

Edward Rudd 13 年之前
父节点
当前提交
82ed3af661
共有 1 个文件被更改,包括 1 次插入1 次删除
  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>