Add m_flEventFrame to the player seat struct

This commit is contained in:
Marco Cawthorne 2021-03-30 07:32:24 +02:00
parent eb543c189d
commit 12183f669f
4 changed files with 13 additions and 14 deletions

View File

@ -42,6 +42,7 @@ struct
void(void) m_pEventCall;
float m_flEventTime;
float m_flEventFrame;
int m_iLastWeapon;
int m_iOldWeapon;

View File

@ -179,6 +179,7 @@ w_glock_primary(void)
} else {
Weapons_ViewAnimation(GLOCK_SHOOT_EMPTY);
}
View_AddEvent(w_glock_ejectshell, 0.0f);
#else
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, Skill_GetValue("plr_9mm_bullet", 8), [0.01,0.01], WEAPON_GLOCK);

View File

@ -136,19 +136,6 @@ w_mp5_primary(void)
return;
}
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
#else
/* singleplayer is more accurate */
if (cvar("sv_playerslots") == 1) {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet", 5), [0.025,0.025], WEAPON_MP5);
} else {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet", 5), [0.05,0.05], WEAPON_MP5);
}
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.shoot");
#endif
pl.mp5_mag--;
/* Actual firing */
@ -162,7 +149,17 @@ w_mp5_primary(void)
Weapons_ViewPunchAngle([-2,0,0]);
#ifdef CLIENT
View_SetMuzzleflash(MUZZLE_RIFLE);
View_AddEvent(w_glock_ejectshell, 0.0f);
#else
/* singleplayer is more accurate */
if (cvar("sv_playerslots") == 1) {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet", 5), [0.025,0.025], WEAPON_MP5);
} else {
TraceAttack_FireBullets(1, Weapons_GetCameraPos(), Skill_GetValue("plr_9mmAR_bullet", 5), [0.05,0.05], WEAPON_MP5);
}
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.shoot");
#endif
pl.w_attack_next = 0.1f;

View File

@ -225,8 +225,8 @@ w_shotgun_secondary(void)
TraceAttack_FireBullets(8, pl.origin + pl.view_ofs, 5, [0.17365,0.04362], WEAPON_SHOTGUN);
}
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.double");
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_buckshot, __NULL__);
#else
View_SetMuzzleflash(MUZZLE_WEIRD);
Weapons_ViewAnimation(SHOTGUN_FIRE2);
Weapons_ViewPunchAngle([-10,0,0]);
View_AddEvent(w_shotgun_ejectshell, 1.0f);