diff --git a/src/client/defs.h b/src/client/defs.h index ac6f10d..ec658c4 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -25,3 +25,5 @@ var string g_tfchud4_spr; var string g_tfchud5_spr; var string g_tfchud6_spr; var string g_tfchud7_spr; + +var int MUZZLE_ROUND; diff --git a/src/client/init.qc b/src/client/init.qc index cb18761..28cba04 100644 --- a/src/client/init.qc +++ b/src/client/init.qc @@ -67,4 +67,5 @@ ClientGame_RendererRestart(string rstr) MUZZLE_RIFLE = (int)getmodelindex("sprites/muzzleflash1.spr"); MUZZLE_SMALL = (int)getmodelindex("sprites/muzzleflash2.spr"); MUZZLE_WEIRD = (int)getmodelindex("sprites/muzzleflash3.spr"); + MUZZLE_ROUND = (int)getmodelindex("sprites/muzzleflash.spr"); } diff --git a/src/shared/player.qc b/src/shared/player.qc index db48d2d..e3c7ed8 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -198,7 +198,6 @@ player::PredictPreFrame(void) { /* the generic client attributes */ NSClientPlayer::PredictPreFrame(); - SAVE_STATE(classtype); SAVE_STATE(anim_top); SAVE_STATE(anim_top_delay); @@ -219,6 +218,7 @@ player::PredictPreFrame(void) SAVE_STATE(m_iAmmoMedikit); SAVE_STATE(mode_tempstate); + SAVE_STATE(classtype); } /* @@ -233,7 +233,6 @@ player::PredictPostFrame(void) { /* the generic client attributes */ NSClientPlayer::PredictPostFrame(); - ROLL_BACK(classtype); ROLL_BACK(anim_top); ROLL_BACK(anim_top_delay); @@ -254,6 +253,7 @@ player::PredictPostFrame(void) ROLL_BACK(m_iAmmoMedikit); ROLL_BACK(mode_tempstate); + ROLL_BACK(classtype); } #else @@ -312,13 +312,13 @@ player::EvaluateEntity(void) SAVE_STATE(m_iAmmoMedikit); SAVE_STATE(mode_tempstate); + SAVE_STATE(classtype); SAVE_STATE(anim_top); SAVE_STATE(anim_top_delay); SAVE_STATE(anim_top_time); SAVE_STATE(anim_bottom); SAVE_STATE(anim_bottom_time); - SAVE_STATE(classtype); } void diff --git a/src/shared/pmove.qc b/src/shared/pmove.qc index 9d5114f..1410f6e 100644 --- a/src/shared/pmove.qc +++ b/src/shared/pmove.qc @@ -53,7 +53,6 @@ player::Physics_Jump(void) float player::Physics_MaxSpeed(void) { - float maxspeed = serverkeyfloat("phy_maxspeed"); float desiredspeed; /* values courtesy of https://wiki.teamfortress.com/ */ @@ -92,5 +91,5 @@ player::Physics_MaxSpeed(void) if (GetFlags() & FL_CROUCHING) desiredspeed /= 3; - return min(desiredspeed, maxspeed); + return desiredspeed; } \ No newline at end of file diff --git a/src/shared/w_asscan.qc b/src/shared/w_asscan.qc index c95a910..242304b 100644 --- a/src/shared/w_asscan.qc +++ b/src/shared/w_asscan.qc @@ -67,10 +67,13 @@ w_asscan_precache(void) Sound_Precache("weapon_asscan.reload"); Sound_Precache("weapon_asscan.spindown"); Sound_Precache("weapon_asscan.spinup"); -#endif - precache_model("models/v_tfac.mdl"); precache_model("models/w_tfac.mdl"); precache_model("models/p_tfac.mdl"); +#endif + +#ifdef CLIENT + precache_model("models/v_tfac.mdl"); +#endif } int @@ -132,9 +135,7 @@ w_asscan_release(player pl) /* end firing */ if (pl.mode_tempstate == 1) { pl.mode_tempstate = 0; -#ifdef SERVER - Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.spindown"); -#endif + Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.spindown"); Weapons_ViewAnimation(pl, ASSCAN_SPINDOWN); pl.w_attack_next = 1.0f; pl.w_idle_next = pl.w_attack_next; @@ -158,16 +159,16 @@ w_asscan_primary(player pl) return; /* ammo check */ - if (pl.m_iAmmoShells <= 0) + if (pl.m_iAmmoShells <= 0) { + w_asscan_release(pl); return; + } /* spin up first */ if (pl.mode_tempstate == 0) { pl.mode_tempstate = 1; Weapons_ViewAnimation(pl, ASSCAN_SPINUP); -#ifdef SERVER - Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.spinup"); -#endif + Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.spinup"); pl.w_attack_next = 0.5f; pl.w_idle_next = pl.w_attack_next; return; @@ -176,13 +177,13 @@ w_asscan_primary(player pl) Weapons_ViewAnimation(pl, ASSCAN_FIRE); Weapons_ViewPunchAngle(pl, [random(-2, 2),0,0]); + Weapons_Sound(pl, CHAN_WEAPON, "weapon_asscan.fire"); #ifdef CLIENT View_AddEvent(w_asscan_ejectshell, 0.0f); - View_SetMuzzleflash(MUZZLE_RIFLE); + View_SetMuzzleflash(MUZZLE_WEIRD); #else TraceAttack_FireBullets(1, Weapons_GetCameraPos(pl), 8, [0.15,0.15], WEAPON_ASSCAN); - Sound_Play(pl, CHAN_WEAPON, "weapon_asscan.fire"); #endif pl.w_attack_next = 0.1f; @@ -197,7 +198,7 @@ w_asscan_hud(player pl) aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; - Cross_DrawSub(g_cross_spr, [24,24], [0.1875,0], [0.1875, 0.1875]); + Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]); HUD_DrawAmmo2(); @@ -254,7 +255,6 @@ w_asscan_hudpic(player pl, int selected, vector pos, float a) int w_asscan_isempty(player pl) { - if (pl.m_iAmmoShells <= 0) return 1; diff --git a/src/shared/w_autorifle.qc b/src/shared/w_autorifle.qc index a129b66..693884c 100644 --- a/src/shared/w_autorifle.qc +++ b/src/shared/w_autorifle.qc @@ -90,7 +90,7 @@ w_autorifle_primary(player pl) case AUTO_LAST: Weapons_ViewAnimation(pl, SNIPER_AUTOFIRE); #ifdef CLIENT - View_SetMuzzleflash(MUZZLE_WEIRD); + View_SetMuzzleflash(MUZZLE_RIFLE); #endif Weapons_Sound(pl, CHAN_WEAPON, "weapon_sniper.fire"); pl.w_attack_next = 0.1f; diff --git a/src/shared/w_dbs.qc b/src/shared/w_dbs.qc index 544070d..37dff78 100644 --- a/src/shared/w_dbs.qc +++ b/src/shared/w_dbs.qc @@ -101,16 +101,14 @@ w_dbs_primary(player pl) case AUTO_FIRE_FAILED: return; break; + case AUTO_LAST: case AUTO_FIRED: pl.mag_dbs--; Weapons_ViewAnimation(pl, DBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); - Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire"); - pl.w_attack_next = 0.7f; - break; - case AUTO_LAST: - Weapons_ViewAnimation(pl, DBS_FIRE1); - Weapons_ViewPunchAngle(pl, [-2,0,0]); + #ifdef CLIENT + View_SetMuzzleflash(MUZZLE_ROUND); + #endif Weapons_Sound(pl, CHAN_WEAPON, "weapon_dbs.fire"); pl.w_attack_next = 0.7f; break; @@ -166,9 +164,7 @@ void w_dbs_crosshair(player pl) { #ifdef CLIENT - static vector cross_pos; - cross_pos = (g_hudres / 2) + [-12,-12]; - drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL); + Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]); HUD_DrawAmmo1(); HUD_DrawAmmo2(); vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; diff --git a/src/shared/w_flamer.qc b/src/shared/w_flamer.qc index 2e453d3..3152eac 100644 --- a/src/shared/w_flamer.qc +++ b/src/shared/w_flamer.qc @@ -159,9 +159,8 @@ void w_flamer_crosshair(player pl) { #ifdef CLIENT - static vector cross_pos; - cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12]; - drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [72/128,48/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL); + Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]); + //Cross_DrawSub(g_cross_spr, [24,24], [72/128,48/128], [0.1875, 0.1875]); HUD_DrawAmmo2(); vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [0,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE); diff --git a/src/shared/w_glauncher.qc b/src/shared/w_glauncher.qc index a938f7e..7a208e0 100644 --- a/src/shared/w_glauncher.qc +++ b/src/shared/w_glauncher.qc @@ -187,6 +187,8 @@ w_glauncher_postdraw(player pl) #ifdef CLIENT vector aicon_pos; + Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]); + /* ammo counters */ HUD_DrawAmmo1(); HUD_DrawAmmo2(); diff --git a/src/shared/w_nailgun.qc b/src/shared/w_nailgun.qc index 28dc0cf..2a2c930 100644 --- a/src/shared/w_nailgun.qc +++ b/src/shared/w_nailgun.qc @@ -122,6 +122,9 @@ w_nailgun_primary(player pl) } Weapons_ViewAnimation(pl, NAILGUN_SHOOT2); Weapons_ViewPunchAngle(pl, [-1,0,0]); + #ifdef CLIENT + View_SetMuzzleflash(MUZZLE_RIFLE); + #endif #ifndef CLIENT Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire"); #endif diff --git a/src/shared/w_pipebomb.qc b/src/shared/w_pipebomb.qc index 1967a52..776720f 100644 --- a/src/shared/w_pipebomb.qc +++ b/src/shared/w_pipebomb.qc @@ -161,6 +161,8 @@ w_pipebomb_postdraw(player pl) #ifdef CLIENT vector aicon_pos; + Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]); + /* ammo counters */ HUD_DrawAmmo1(); HUD_DrawAmmo2(); diff --git a/src/shared/w_rpg.qc b/src/shared/w_rpg.qc index d811a7b..f88ac64 100644 --- a/src/shared/w_rpg.qc +++ b/src/shared/w_rpg.qc @@ -181,21 +181,9 @@ void w_rpg_hud(player pl) { #ifdef CLIENT - vector cross_pos; vector aicon_pos; - /* crosshair/laser */ - cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12]; - drawsubpic( - cross_pos, - [24,24], - g_cross_spr, - [0,0], - [0.1875, 0.1875], - [1,1,1], - 1, - DRAWFLAG_NORMAL - ); + Cross_DrawSub(g_cross_spr, [24,24], [24/128,48/128], [0.1875, 0.1875]); /* ammo counters */ HUD_DrawAmmo1(); diff --git a/src/shared/w_sbs.qc b/src/shared/w_sbs.qc index 87d7711..41ad4a3 100644 --- a/src/shared/w_sbs.qc +++ b/src/shared/w_sbs.qc @@ -90,13 +90,11 @@ w_sbs_primary(player pl) case AUTO_FIRE_FAILED: return; break; - case AUTO_FIRED: - Weapons_ViewAnimation(pl, SBS_FIRE1); - Weapons_ViewPunchAngle(pl, [-2,0,0]); - Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire"); - pl.w_attack_next = 0.5f; - break; case AUTO_LAST: + case AUTO_FIRED: + #ifdef CLIENT + View_SetMuzzleflash(MUZZLE_ROUND); + #endif Weapons_ViewAnimation(pl, SBS_FIRE1); Weapons_ViewPunchAngle(pl, [-2,0,0]); Weapons_Sound(pl, CHAN_WEAPON, "weapon_sbs.fire"); @@ -154,9 +152,7 @@ void w_sbs_crosshair(player pl) { #ifdef CLIENT - static vector cross_pos; - cross_pos = (g_hudres / 2) + [-12,-12]; - drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [48/128,24/128], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL); + Cross_DrawSub(g_cross_spr, [24,24], [48/128,24/128], [0.1875, 0.1875]); HUD_DrawAmmo1(); HUD_DrawAmmo2(); vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; diff --git a/src/shared/w_sniper.qc b/src/shared/w_sniper.qc index 794e218..cfd7879 100644 --- a/src/shared/w_sniper.qc +++ b/src/shared/w_sniper.qc @@ -92,7 +92,7 @@ w_sniper_primary(player pl) w_baseauto_fire(pl, player::m_iAmmoShells, 8, [0,0]); Weapons_ViewAnimation(pl, SNIPER_FIRE); #ifdef CLIENT - View_SetMuzzleflash(MUZZLE_WEIRD); + View_SetMuzzleflash(MUZZLE_RIFLE); #endif Weapons_Sound(pl, CHAN_WEAPON, "weapon_sniper.fire"); pl.w_attack_next = 2.0f; diff --git a/src/shared/w_supernail.qc b/src/shared/w_supernail.qc index 7ce662e..a4f6438 100644 --- a/src/shared/w_supernail.qc +++ b/src/shared/w_supernail.qc @@ -125,6 +125,9 @@ w_supernail_primary(player pl) } Weapons_ViewAnimation(pl, NAILGUN_SHOOT2); Weapons_ViewPunchAngle(pl, [-1,0,0]); + #ifdef CLIENT + View_SetMuzzleflash(MUZZLE_RIFLE); + #endif #ifndef CLIENT Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire"); #endif @@ -142,22 +145,9 @@ void w_supernail_hud(player pl) { #ifdef CLIENT - vector cross_pos; vector aicon_pos; - /* crosshair/laser */ - cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12]; - drawsubpic( - cross_pos, - [24,24], - g_cross_spr, - [0.1875,0], - [0.1875, 0.1875], - [1,1,1], - 1.0f, - DRAWFLAG_NORMAL - ); - + Cross_DrawSub(g_cross_spr, [24,24], [0.1875,0], [0.1875, 0.1875]); HUD_DrawAmmo2(); aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42]; diff --git a/zpak001.pk3dir/sound/weapons_tfc.sndshd b/zpak001.pk3dir/sound/weapons_tfc.sndshd index bc29bb8..f81a34f 100644 --- a/zpak001.pk3dir/sound/weapons_tfc.sndshd +++ b/zpak001.pk3dir/sound/weapons_tfc.sndshd @@ -1,6 +1,6 @@ weapon_asscan.fire { - pitch 1.15 + //pitch 1.15 sample weapons/asscan2.wav }