X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=5478180bf23ed93ddf84d425087edbd16e20f605;hb=1443e95fdfcecd289bb2801121198caad9ecd039;hp=7c73eb7e5754a68adf1831829d273a22c7b04fba;hpb=f517a19e84dae6941cff317aaf6fbcc3a5c5bb6f;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 7c73eb7..5478180 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -191,7 +191,7 @@ type FSavedStateNum: Integer; FModel: TPlayerModel; - FPunchAnim: TAnimation; + FPunchAnim: TAnimationState; FActionPrior: Byte; FActionAnim: Byte; FActionForce: Boolean; @@ -403,7 +403,7 @@ type property Berserk: Integer read FBerserk; property Pain: Integer read FPain; property Pickup: Integer read FPickup; - property PunchAnim: TAnimation read FPunchAnim write FPunchAnim; + property PunchAnim: TAnimationState read FPunchAnim write FPunchAnim; property SpawnInvul: Integer read FSpawnInvul; property Ghost: Boolean read FGhost; @@ -2123,6 +2123,8 @@ begin FNetTime := 0; FWaitForFirstSpawn := false; + FPunchAnim := TAnimationState.Create(False, 1, 4); + FPunchAnim.Disable; resetWeaponQueue(); end; @@ -2269,31 +2271,15 @@ begin FJetSoundOn.Free(); FJetSoundOff.Free(); FModel.Free(); - if FPunchAnim <> nil then - FPunchAnim.Free(); + FPunchAnim.Free(); inherited; end; procedure TPlayer.DoPunch(); -var - id: DWORD; - st: String; begin - if FPunchAnim <> nil then begin - FPunchAnim.reset(); - FPunchAnim.Free; - FPunchAnim := nil; - end; - st := 'FRAMES_PUNCH'; - if R_BERSERK in FRulez then - st := st + '_BERSERK'; - if FKeys[KEY_UP].Pressed then - st := st + '_UP' - else if FKeys[KEY_DOWN].Pressed then - st := st + '_DN'; - g_Frames_Get(id, st); - FPunchAnim := TAnimation.Create(id, False, 1); + FPunchAnim.Reset; + FPunchAnim.Enable; end; procedure TPlayer.Fire(); @@ -4295,8 +4281,10 @@ begin FLoss := 0; end; - if FAlive and (FPunchAnim <> nil) then - FPunchAnim.Update(); + if FAlive then + FPunchAnim.Update; + if FPunchAnim.played then + FPunchAnim.Disable; if FAlive and (gFly or FJetpack) then FlySmoke();