From 84b8e583ca021081faf5b94cb987e080c1764db4 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sun, 29 Aug 2021 23:01:19 +0200 Subject: [PATCH] WEAPON_EGON: Fix jerky animation on idle. --- src/shared/w_egon.qc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/shared/w_egon.qc b/src/shared/w_egon.qc index a9f9640..2b78b09 100644 --- a/src/shared/w_egon.qc +++ b/src/shared/w_egon.qc @@ -241,20 +241,21 @@ void w_egon_release(void) p.alpha = 0.0f; #endif - if (pl.mode_tempstate != 0) { + if (pl.mode_tempstate != 0 && pl.mode_tempstate < 3) { #ifdef SERVER sound(pl, CHAN_WEAPON, "weapons/egon_off1.wav", 1, ATTN_NORM, 100, 0); #endif - pl.mode_tempstate = 0; + pl.mode_tempstate = 3; Weapons_ViewPunchAngle([-2,0,0]); } pl.gflags &= ~GF_EGONBEAM; -#ifndef SERVER - if (Weapons_GetAnimation() == EGON_ALTFIRECYCLE) { + if (pl.mode_tempstate == 3) { Weapons_ViewAnimation(EGON_ALTFIREOFF); pl.w_idle_next = 1.0f; + pl.w_attack_next = 1.1f; + pl.mode_tempstate = 0; } else { if (pl.w_idle_next > 0.0f) { return; @@ -267,8 +268,8 @@ void w_egon_release(void) Weapons_ViewAnimation(EGON_IDLE1); pl.w_idle_next = 2.0f; } + pl.mode_tempstate = 0; } -#endif } void w_egon_crosshair(void) {