DEADSOFTWARE

gl: implement touch screen controls
[d2df-sdl.git] / src / game / opengl / r_player.pas
index 6204da3b78fe1c5b004b37d75c0a624f9335917a..1beb1e4d78269e1aa8fdb423518bf708f6e43d2e 100644 (file)
@@ -452,12 +452,12 @@ begin
     else
       Mirror := TMirrorType.Horizontal;
 
-    if p.PunchAnim.enabled then
+    if p.PunchAnim.IsValid() and p.PunchAnim.enabled then
     begin
       if p.FKeys[KEY_DOWN].Pressed then ID := PunchFrames[R_BERSERK in p.FRulez, 2]
       else if p.FKeys[KEY_UP].Pressed then ID := PunchFrames[R_BERSERK in p.FRulez, 1]
       else ID := PunchFrames[R_BERSERK in p.FRulez, 0];
-      r_AnimationState_Draw(ID, p.PunchAnim, fX + IfThen(p.Direction = TDirection.D_LEFT, 15 - p.Obj.Rect.X, p.Obj.Rect.X - 15), fY + fSlope + p.Obj.Rect.Y - 11, 0, Mirror, False);
+      r_AnimState_Draw(ID, p.PunchAnim, fX + IfThen(p.Direction = TDirection.D_LEFT, 15 - p.Obj.Rect.X, p.Obj.Rect.X - 15), fY + fSlope + p.Obj.Rect.Y - 11, 0, Mirror, False);
     end;
 
     if (p.FMegaRulez[MR_INVUL] > gTime) and ((gPlayerDrawn <> p) or (p.SpawnInvul >= gTime)) then