WEAPON_EGON: Fix jerky animation on idle.

This commit is contained in:
Marco Cawthorne 2021-08-29 23:01:19 +02:00
parent 7f9f3c7d9a
commit 84b8e583ca

View file

@ -241,20 +241,21 @@ void w_egon_release(void)
p.alpha = 0.0f; p.alpha = 0.0f;
#endif #endif
if (pl.mode_tempstate != 0) { if (pl.mode_tempstate != 0 && pl.mode_tempstate < 3) {
#ifdef SERVER #ifdef SERVER
sound(pl, CHAN_WEAPON, "weapons/egon_off1.wav", 1, ATTN_NORM, 100, 0); sound(pl, CHAN_WEAPON, "weapons/egon_off1.wav", 1, ATTN_NORM, 100, 0);
#endif #endif
pl.mode_tempstate = 0; pl.mode_tempstate = 3;
Weapons_ViewPunchAngle([-2,0,0]); Weapons_ViewPunchAngle([-2,0,0]);
} }
pl.gflags &= ~GF_EGONBEAM; pl.gflags &= ~GF_EGONBEAM;
#ifndef SERVER if (pl.mode_tempstate == 3) {
if (Weapons_GetAnimation() == EGON_ALTFIRECYCLE) {
Weapons_ViewAnimation(EGON_ALTFIREOFF); Weapons_ViewAnimation(EGON_ALTFIREOFF);
pl.w_idle_next = 1.0f; pl.w_idle_next = 1.0f;
pl.w_attack_next = 1.1f;
pl.mode_tempstate = 0;
} else { } else {
if (pl.w_idle_next > 0.0f) { if (pl.w_idle_next > 0.0f) {
return; return;
@ -267,8 +268,8 @@ void w_egon_release(void)
Weapons_ViewAnimation(EGON_IDLE1); Weapons_ViewAnimation(EGON_IDLE1);
pl.w_idle_next = 2.0f; pl.w_idle_next = 2.0f;
} }
pl.mode_tempstate = 0;
} }
#endif
} }
void w_egon_crosshair(void) void w_egon_crosshair(void)
{ {