diff --git a/src/client/defs.h b/src/client/defs.h index b94079e..8c82035 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -60,8 +60,12 @@ struct entity m_eViewModel; entity m_eMuzzleflash; int m_iVMBones; - int m_iVMEjectBone; + + /* viewmodel shell ejection */ float m_fEjectModel; + vector m_vecEjectPos; + vector m_vecEjectVel; + int m_iLastWeapon; int m_iOldWeapon; float m_flBobTime; diff --git a/src/shared/w_ak47.qc b/src/shared/w_ak47.qc index 4cb1d65..bfc2b9c 100644 --- a/src/shared/w_ak47.qc +++ b/src/shared/w_ak47.qc @@ -126,7 +126,7 @@ w_ak47_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_aug.qc b/src/shared/w_aug.qc index fdaa250..a5fd858 100644 --- a/src/shared/w_aug.qc +++ b/src/shared/w_aug.qc @@ -126,7 +126,7 @@ w_aug_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_deagle.qc b/src/shared/w_deagle.qc index 6f2bb8a..daeddad 100644 --- a/src/shared/w_deagle.qc +++ b/src/shared/w_deagle.qc @@ -129,7 +129,7 @@ w_deagle_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.deagle_mag <= 0) { Weapons_ViewAnimation(DEAGLE_SHOOT_EMPTY); diff --git a/src/shared/w_elites.qc b/src/shared/w_elites.qc index 70c106a..d68fe0a 100644 --- a/src/shared/w_elites.qc +++ b/src/shared/w_elites.qc @@ -144,7 +144,7 @@ w_elites_primary(void) int r = (float)input_sequence % 5; if (pl.mode_temp) { - View_EjectShell(SHELL_PISTOL, 1); + View_EjectShellAttachment(SHELL_PISTOL, 1, [0, -80, 100]); if (pl.elites_mag <= 0) { Weapons_ViewAnimation(ELITES_SHOOT_LEFTLAST); @@ -168,7 +168,7 @@ w_elites_primary(void) } } } else { - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, 80, 100]); if (pl.elites_mag <= 0) { Weapons_ViewAnimation(ELITES_SHOOT_RIGHTLAST); } else { diff --git a/src/shared/w_fiveseven.qc b/src/shared/w_fiveseven.qc index 7bd4755..785e63a 100644 --- a/src/shared/w_fiveseven.qc +++ b/src/shared/w_fiveseven.qc @@ -129,7 +129,7 @@ w_fiveseven_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.fiveseven_mag <= 0) { Weapons_ViewAnimation(FIVESEVEN_SHOOT_EMPTY); diff --git a/src/shared/w_g3sg1.qc b/src/shared/w_g3sg1.qc index c75ecba..cfc1cf9 100644 --- a/src/shared/w_g3sg1.qc +++ b/src/shared/w_g3sg1.qc @@ -124,7 +124,7 @@ w_g3sg1_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_glock18.qc b/src/shared/w_glock18.qc index d545566..ef5f0e9 100644 --- a/src/shared/w_glock18.qc +++ b/src/shared/w_glock18.qc @@ -159,7 +159,7 @@ w_glock18_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); #else if (pl.flags & FL_CROUCHING) diff --git a/src/shared/w_m4a1.qc b/src/shared/w_m4a1.qc index 366aec0..873c2b0 100644 --- a/src/shared/w_m4a1.qc +++ b/src/shared/w_m4a1.qc @@ -146,7 +146,7 @@ w_m4a1_primary(void) } else { View_SetMuzzleflash(MUZZLE_RIFLE); } - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); /* this stuff is predicted */ int r = (float)input_sequence % 3; diff --git a/src/shared/w_mac10.qc b/src/shared/w_mac10.qc index b7e059d..4cc63b7 100644 --- a/src/shared/w_mac10.qc +++ b/src/shared/w_mac10.qc @@ -125,7 +125,7 @@ w_mac10_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_mp5.qc b/src/shared/w_mp5.qc index cad5222..b33b327 100644 --- a/src/shared/w_mp5.qc +++ b/src/shared/w_mp5.qc @@ -125,7 +125,7 @@ w_mp5_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_p228.qc b/src/shared/w_p228.qc index 41e8f57..24b4711 100644 --- a/src/shared/w_p228.qc +++ b/src/shared/w_p228.qc @@ -129,7 +129,7 @@ w_p228_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); if (pl.p228_mag <= 0) { Weapons_ViewAnimation(P228_SHOOT_EMPTY); diff --git a/src/shared/w_p90.qc b/src/shared/w_p90.qc index b77f1b3..0291087 100644 --- a/src/shared/w_p90.qc +++ b/src/shared/w_p90.qc @@ -125,7 +125,7 @@ w_p90_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_para.qc b/src/shared/w_para.qc index cd1c23d..2d7241e 100644 --- a/src/shared/w_para.qc +++ b/src/shared/w_para.qc @@ -124,7 +124,7 @@ w_para_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_sg550.qc b/src/shared/w_sg550.qc index effa083..7470682 100644 --- a/src/shared/w_sg550.qc +++ b/src/shared/w_sg550.qc @@ -124,7 +124,7 @@ w_sg550_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 2; switch (r) { diff --git a/src/shared/w_sg552.qc b/src/shared/w_sg552.qc index b0dc01b..7c775be 100644 --- a/src/shared/w_sg552.qc +++ b/src/shared/w_sg552.qc @@ -125,7 +125,7 @@ w_sg552_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_RIFLE, 0); + View_EjectShellAttachment(SHELL_RIFLE, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_tmp.qc b/src/shared/w_tmp.qc index df4d9ca..bad10a0 100644 --- a/src/shared/w_tmp.qc +++ b/src/shared/w_tmp.qc @@ -127,7 +127,7 @@ w_tmp_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); int r = (float)input_sequence % 3; switch (r) { diff --git a/src/shared/w_ump45.qc b/src/shared/w_ump45.qc index 8f4960a..f61cfd6 100644 --- a/src/shared/w_ump45.qc +++ b/src/shared/w_ump45.qc @@ -127,7 +127,7 @@ w_ump45_primary(void) #ifdef CLIENT View_SetMuzzleflash(MUZZLE_RIFLE); - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); #else TraceAttack_SetPenetrationPower(0); TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 30, [accuracy,accuracy], WEAPON_UMP45); diff --git a/src/shared/w_usp45.qc b/src/shared/w_usp45.qc index 2328a5c..d0e6d86 100644 --- a/src/shared/w_usp45.qc +++ b/src/shared/w_usp45.qc @@ -155,7 +155,7 @@ w_usp45_primary(void) View_SetMuzzleflash(MUZZLE_SMALL); } - View_EjectShell(SHELL_PISTOL, 0); + View_EjectShellAttachment(SHELL_PISTOL, 0, [0, -80, 100]); #else /* Different sounds without silencer */ if (pl.mode_usp45 == 1) {