FSavedStateNum: Integer;
FModel: TPlayerModel;
- FPunchAnim: TAnimationState;
+ FPunchAnim: TAnimState;
FActionPrior: Byte;
FActionAnim: Byte;
FActionForce: Boolean;
property Berserk: Integer read FBerserk;
property Pain: Integer read FPain;
property Pickup: Integer read FPickup;
- property PunchAnim: TAnimationState read FPunchAnim write FPunchAnim;
+ property PunchAnim: TAnimState read FPunchAnim write FPunchAnim;
property SpawnInvul: Integer read FSpawnInvul;
property Ghost: Boolean read FGhost;
FNetTime := 0;
FWaitForFirstSpawn := false;
- FPunchAnim := TAnimationState.Create(False, 1, 4);
+ FPunchAnim := TAnimState.Create(False, 1, 4);
FPunchAnim.Disable;
resetWeaponQueue();
FJetSoundOn.Free();
FJetSoundOff.Free();
FModel.Free();
- FPunchAnim.Free();
+ FPunchAnim.Invalidate;
inherited;
end;
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