From cc48c2c994d911fd1734e27fd82db665153b750a Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Tue, 6 Apr 2021 09:20:35 +0200 Subject: [PATCH] Handle player weapon model attachments for all the weapons! --- src/client/entities.qc | 5 ++ src/client/player.qc | 44 ----------- src/client/progs.src | 2 +- src/server/gamerules.qc | 1 - src/shared/animations.h | 2 - src/shared/animations.qc | 162 ++++++++++++++++---------------------- src/shared/player.h | 69 +++++++++++----- src/shared/w_ak47.qc | 4 +- src/shared/w_aug.qc | 4 +- src/shared/w_awp.qc | 4 +- src/shared/w_deagle.qc | 4 +- src/shared/w_elites.qc | 8 +- src/shared/w_fiveseven.qc | 4 +- src/shared/w_g3sg1.qc | 4 +- src/shared/w_glock18.qc | 4 +- src/shared/w_knife.qc | 4 +- src/shared/w_m3.qc | 4 +- src/shared/w_m4a1.qc | 4 +- src/shared/w_mac10.qc | 4 +- src/shared/w_mp5.qc | 4 +- src/shared/w_p228.qc | 4 +- src/shared/w_p90.qc | 4 +- src/shared/w_para.qc | 4 +- src/shared/w_scout.qc | 4 +- src/shared/w_sg550.qc | 4 +- src/shared/w_sg552.qc | 4 +- src/shared/w_tmp.qc | 4 +- src/shared/w_ump45.qc | 4 +- src/shared/w_usp45.qc | 4 +- src/shared/w_xm1014.qc | 4 +- 30 files changed, 174 insertions(+), 207 deletions(-) delete mode 100644 src/client/player.qc diff --git a/src/client/entities.qc b/src/client/entities.qc index a56f667..7531671 100644 --- a/src/client/entities.qc +++ b/src/client/entities.qc @@ -27,3 +27,8 @@ ClientGame_EntityUpdate(float id, float new) return TRUE; } + +void +ClientGame_EntityRemove(void) +{ +} diff --git a/src/client/player.qc b/src/client/player.qc deleted file mode 100644 index af12e09..0000000 --- a/src/client/player.qc +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016-2020 Marco Hladik - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -void -Player_PreDraw(base_player pl, int thirdperson) -{ - /* Handle the flashlights... */ - if (pl.gflags & GF_FLASHLIGHT) { - vector src; - vector ang; - - if (pl.entnum != player_localentnum) { - src = pl.origin + pl.view_ofs; - ang = [pl.pitch, pl.angles[1], pl.angles[2]]; - } else { - src = pSeat->m_vecPredictedOrigin + [0,0,-8]; - ang = view_angles; - } - - makevectors(ang); - traceline(src, src + (v_forward * 8096), MOVE_NORMAL, pl); - - if (serverkeyfloat("*bspversion") == BSPVER_HL) { - dynamiclight_add(trace_endpos + (v_forward * -2), 128, [1,1,1]); - } else { - float p = dynamiclight_add(src, 512, [1,1,1], 0, "textures/flashlight"); - dynamiclight_set(p, LFIELD_ANGLES, ang); - dynamiclight_set(p, LFIELD_FLAGS, 3); - } - } -} diff --git a/src/client/progs.src b/src/client/progs.src index e80eb13..d9cd6d9 100644 --- a/src/client/progs.src +++ b/src/client/progs.src @@ -24,7 +24,7 @@ nightvision.qc draw.qc textmenu.qc init.qc -player.qc +../../../valve/src/client/player.qc entities.qc cmds.qc game_event.qc diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index cc0f4c3..224c3fb 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -37,7 +37,6 @@ CSGameRules::BuyingPossible(base_player pl) void CSGameRules::PlayerPostFrame(base_player pp) { - Animation_PlayerUpdate(); } void diff --git a/src/shared/animations.h b/src/shared/animations.h index 920874d..5bbfe7b 100644 --- a/src/shared/animations.h +++ b/src/shared/animations.h @@ -113,5 +113,3 @@ enum ANIM_CROUCH_DIE }; -void Animation_PlayerTop(float); -void Animation_PlayerTopTemp(float, float); diff --git a/src/shared/animations.qc b/src/shared/animations.qc index 0b064c1..f2e8bfe 100755 --- a/src/shared/animations.qc +++ b/src/shared/animations.qc @@ -28,6 +28,8 @@ .float lerpfrac; .float subblend2frac; .float subblendfrac; +.float basesubblend2frac; +.float basesubblendfrac; void Animation_Print(string sWow) { #ifdef CLIENT @@ -37,6 +39,23 @@ void Animation_Print(string sWow) { #endif } +void +Animation_TimerUpdate(player pl) +{ + makevectors([0, pl.angles[1], 0]); + + /* top animation is always just being incremented */ + pl.anim_top_time += input_timelength; + pl.anim_top_delay -= input_timelength; + + /* we may be walking backwards, thus decrement bottom */ + if (dotproduct(pl.velocity, v_forward) < 0) { + pl.anim_bottom_time -= input_timelength; + } else { + pl.anim_bottom_time += input_timelength; + } +} + /* ================= Animation_PlayerUpdate @@ -45,114 +64,71 @@ Called every frame to update the animation sequences depending on what the player is doing ================= */ -void Animation_PlayerUpdate(void) { - self.basebone = 39; +void +Animation_PlayerUpdate(player pl) +{ + pl.basebone = 39; - if (self.baseframe_time < time) { - base_player pl = (base_player)self; - self.baseframe = Weapons_GetAim(pl.activeweapon); - self.baseframe_old = self.frame; + if (pl.anim_top_delay <= 0.0f) { + pl.anim_top = Weapons_GetAim(pl.activeweapon); } - /* in order to appear jumping, we want to not be on ground, - * but also make sure we're not just going down a ramp */ - if (!(self.flags & FL_ONGROUND) && (self.velocity[2] > 0 || self.frame == ANIM_JUMP)) { - self.frame = ANIM_JUMP; - } else if (vlen(self.velocity) == 0) { - if (self.flags & FL_CROUCHING) { - self.frame = ANIM_IDLE_CROUCH; + if (vlen(pl.velocity) == 0) { + if (pl.flags & FL_CROUCHING) { + pl.anim_bottom = ANIM_IDLE_CROUCH; } else { - self.frame = ANIM_IDLE; + pl.anim_bottom = ANIM_IDLE; } - } else if (vlen(self.velocity) < 150) { - if (self.flags & FL_CROUCHING) { - self.frame = ANIM_RUN_CROUCH; + } else if (vlen(pl.velocity) < 150) { + if (pl.flags & FL_CROUCHING) { + pl.anim_bottom = ANIM_RUN_CROUCH; } else { - self.frame = ANIM_WALK; + pl.anim_bottom = ANIM_WALK; } - } else if (vlen(self.velocity) > 150) { - if (self.flags & FL_CROUCHING) { - self.frame = ANIM_RUN_CROUCH; + } else if (vlen(pl.velocity) > 150) { + if (pl.flags & FL_CROUCHING) { + pl.anim_bottom = ANIM_RUN_CROUCH; } else { - self.frame = ANIM_RUN; + pl.anim_bottom = ANIM_RUN; } } - // Lerp it down! - if (self.lerpfrac > 0) { - self.lerpfrac -= frametime * 5; - if (self.lerpfrac < 0) { - self.lerpfrac = 0; - } + pl.baseframe = pl.anim_top; + pl.baseframe1time = pl.anim_top_time; + pl.frame = pl.anim_bottom; + pl.frame1time = pl.anim_bottom_time; + + /* hack, we can't play the animations in reverse the normal way */ + if (pl.frame1time < 0.0f) { + pl.frame1time = 10.0f; } - if (self.baselerpfrac > 0) { - self.baselerpfrac -= frametime * 5; - if (self.baselerpfrac < 0) { - self.baselerpfrac = 0; - } - } - - if (self.frame != self.frame_last) { - //Animation_Print(sprintf("New Frame: %d, Last Frame: %d\n", self.frame, self.frame_last)); - - // Move everything over to frame 2 - self.frame2time = self.frame1time; - self.frame2 = self.frame_last; - - // Set frame_last to avoid this being called again - self.frame_last = self.frame; - - self.lerpfrac = 1.0f; - self.frame1time = 0.0f; - } + makevectors([0, pl.angles[1], 0]); + float fCorrect = dotproduct(pl.velocity, v_right) * 0.25f; - if (self.baseframe != self.baseframe_last) { - //Animation_Print(sprintf("New Baseframe: %d, Last Baseframe: %d\n", self.baseframe, self.baseframe_last)); - - // Move everything over to frame 2 - self.baseframe2time = self.baseframe1time; - self.baseframe2 = self.baseframe_last; - - // Set frame_last to avoid this being called again - self.baseframe_last = self.baseframe; - - self.baselerpfrac = 1.0f; - self.baseframe1time = 0.0f; - } - - // Force the code above to update if we switched positions - if (self.fWasCrouching != (self.flags & FL_CROUCHING)) { - self.baseframe_old = 0; - self.baseframe_time = 0; - self.fWasCrouching = (self.flags & FL_CROUCHING); - } + pl.subblendfrac = -fCorrect * 0.05f; + pl.subblend2frac *= -0.1f; + pl.angles[1] -= fCorrect; #ifdef SERVER - // On the CSQC it's done in Player.c - self.subblendfrac = - self.subblend2frac = self.v_angle[0] / 90; -#endif - - self.angles[0] = self.angles[2] = 0; -} - -/* -================= -Animation_PlayerTop - -Changes the animation sequence for the upper body part -================= -*/ -void Animation_PlayerTop(float fFrame) { - self.baseframe = fFrame; - self.baseframe_old = fFrame; -} - -void Animation_PlayerTopTemp(float fFrame, float fTime) { - self.baseframe = fFrame; - self.baseframe_time = time + fTime; -#ifdef SERVER - self.SendFlags |= PLAYER_FRAME; + pl.basesubblendfrac = + pl.basesubblend2frac = pl.v_angle[0] / 90; +#else + pl.basesubblendfrac = + pl.basesubblend2frac = pl.pitch / 90; #endif } + +void +Animation_PlayerTop(player pl, float topanim, float timer) +{ + pl.anim_top = topanim; + pl.anim_top_time = 0.0f; + pl.anim_top_delay = timer; +} + +void +Animation_PlayerBottom(player pl, float botanim, float timer) +{ + pl.anim_bottom = botanim; +} diff --git a/src/shared/player.h b/src/shared/player.h index 8141f5f..ebb0c70 100644 --- a/src/shared/player.h +++ b/src/shared/player.h @@ -32,8 +32,8 @@ enumflags PLAYER_ARMOR, PLAYER_MOVETYPE, PLAYER_VIEWOFS, - PLAYER_BASEFRAME, - PLAYER_FRAME, + PLAYER_TOPFRAME, + PLAYER_BOTTOMFRAME, PLAYER_AMMO1, PLAYER_AMMO2, PLAYER_AMMO3, @@ -184,6 +184,12 @@ class player:base_player float cs_shottime; float cs_shottime_net; + float anim_top; float anim_top_net; + float anim_top_time; float anim_top_time_net; + float anim_top_delay; float anim_top_delay_net; + float anim_bottom; float anim_bottom_net; + float anim_bottom_time; float anim_bottom_time_net; + #ifdef CLIENT /* External model */ entity p_model; @@ -196,7 +202,6 @@ class player:base_player int cs_cross_deltadist; float cs_crosshairdistance; - virtual void(void) gun_offset; virtual void(void) draw; virtual float() predraw; virtual void(void) postdraw; @@ -281,12 +286,16 @@ player::ReceiveEntity(float new) movetype = readbyte(); if (fl & PLAYER_VIEWOFS) view_ofs[2] = readfloat(); - if (fl & PLAYER_BASEFRAME) - baseframe = readbyte(); - if (fl & PLAYER_FRAME) { - frame = readbyte(); - frame1time = 0.0f; - frame2time = 0.0f; + + /* animation */ + if (fl & PLAYER_TOPFRAME) { + anim_top = readbyte(); + anim_top_time = readfloat(); + anim_top_delay = readfloat(); + } + if (fl & PLAYER_BOTTOMFRAME) { + anim_bottom = readbyte(); + anim_bottom_time = readfloat(); } if (fl & PLAYER_AMMO1) { @@ -405,6 +414,12 @@ player::PredictPreFrame(void) cs_shotmultiplier_net = cs_shotmultiplier; cs_shottime_net = cs_shottime; + + anim_top_net = anim_top; + anim_top_delay_net = anim_top_delay; + anim_top_time_net = anim_top_time; + anim_bottom_net = anim_bottom; + anim_bottom_time_net = anim_bottom_time; } /* @@ -461,6 +476,12 @@ player::PredictPostFrame(void) cs_shotmultiplier = cs_shotmultiplier_net; cs_shottime = cs_shottime_net; + + anim_top = anim_top_net; + anim_top_delay = anim_top_delay_net; + anim_top_time = anim_top_time_net; + anim_bottom = anim_bottom_net; + anim_bottom_time = anim_bottom_time_net; } #else @@ -523,11 +544,11 @@ player::EvaluateEntity(void) if (old_viewofs != view_ofs[2]) SendFlags |= PLAYER_VIEWOFS; - if (old_baseframe != baseframe) - SendFlags |= PLAYER_BASEFRAME; - - if (old_frame != frame) - SendFlags |= PLAYER_FRAME; + /* animation */ + if (anim_bottom_net != anim_bottom || anim_bottom_time != anim_bottom_time_net) + SendFlags |= PLAYER_BOTTOMFRAME; + if (anim_top_net != anim_top || anim_top_time != anim_top_time_net || anim_top_delay != anim_top_delay_net) + SendFlags |= PLAYER_TOPFRAME; /* ammo 1 type updates */ if (glock18_mag_net != glock18_mag) @@ -679,6 +700,12 @@ player::EvaluateEntity(void) cs_shotmultiplier_net = cs_shotmultiplier; cs_shottime_net = cs_shottime; + anim_top_net = anim_top; + anim_top_delay_net = anim_top_delay; + anim_top_time_net = anim_top_time; + anim_bottom_net = anim_bottom; + anim_bottom_time_net = anim_bottom_time; + if (g_cs_gamestate != GAME_FREEZE) { if (progress <= 0.0f) { flags &= ~FL_FROZEN; @@ -757,10 +784,16 @@ player::SendEntity(entity ePEnt, float fChanged) WriteByte(MSG_ENTITY, movetype); if (fChanged & PLAYER_VIEWOFS) WriteFloat(MSG_ENTITY, view_ofs[2]); - if (fChanged & PLAYER_BASEFRAME) - WriteByte(MSG_ENTITY, baseframe); - if (fChanged & PLAYER_FRAME) - WriteByte(MSG_ENTITY, frame); + + if (fChanged & PLAYER_TOPFRAME) { + WriteByte(MSG_ENTITY, anim_top); + WriteFloat(MSG_ENTITY, anim_top_time); + WriteFloat(MSG_ENTITY, anim_top_delay); + } + if (fChanged & PLAYER_BOTTOMFRAME) { + WriteByte(MSG_ENTITY, anim_bottom); + WriteFloat(MSG_ENTITY, anim_bottom_time); + } if (fChanged & PLAYER_AMMO1) { WriteByte(MSG_ENTITY, usp45_mag); diff --git a/src/shared/w_ak47.qc b/src/shared/w_ak47.qc index 674c078..8c070ce 100644 --- a/src/shared/w_ak47.qc +++ b/src/shared/w_ak47.qc @@ -178,9 +178,9 @@ w_ak47_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 36, [accuracy,accuracy], WEAPON_AK47); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_AK47, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_AK47, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_AK47, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_AK47, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_ak47.fire"); #endif diff --git a/src/shared/w_aug.qc b/src/shared/w_aug.qc index 115ddc5..e9601bc 100644 --- a/src/shared/w_aug.qc +++ b/src/shared/w_aug.qc @@ -145,9 +145,9 @@ w_aug_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 32, [accuracy,accuracy], WEAPON_AUG); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_aug.fire"); #endif diff --git a/src/shared/w_awp.qc b/src/shared/w_awp.qc index 5091dfb..f2424b3 100644 --- a/src/shared/w_awp.qc +++ b/src/shared/w_awp.qc @@ -233,9 +233,9 @@ w_awp_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 115, [accuracy,accuracy], WEAPON_AWP); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_awp.fire"); #endif diff --git a/src/shared/w_deagle.qc b/src/shared/w_deagle.qc index ef0dc85..d22e06c 100644 --- a/src/shared/w_deagle.qc +++ b/src/shared/w_deagle.qc @@ -181,9 +181,9 @@ w_deagle_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 54, [accuracy,accuracy], WEAPON_DEAGLE); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); else - Animation_PlayerTopTemp(ANIM_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_ONEHAND, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_deagle.fire"); #endif diff --git a/src/shared/w_elites.qc b/src/shared/w_elites.qc index 367c231..c768c60 100644 --- a/src/shared/w_elites.qc +++ b/src/shared/w_elites.qc @@ -238,14 +238,14 @@ w_elites_primary(void) if (self.flags & FL_CROUCHING) { if (pl.mode_temp) - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT2_DUALPISTOLS, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT2_DUALPISTOLS, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_DUALPISTOLS, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_DUALPISTOLS, 0.45f); } else { if (pl.mode_temp) - Animation_PlayerTopTemp(ANIM_SHOOT2_DUALPISTOLS, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT2_DUALPISTOLS, 0.45f); else - Animation_PlayerTopTemp(ANIM_SHOOT_DUALPISTOLS, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_DUALPISTOLS, 0.45f); } Sound_Play(pl, CHAN_WEAPON, "weapon_elites.fire"); diff --git a/src/shared/w_fiveseven.qc b/src/shared/w_fiveseven.qc index 0e699b1..8f04c8a 100644 --- a/src/shared/w_fiveseven.qc +++ b/src/shared/w_fiveseven.qc @@ -149,9 +149,9 @@ w_fiveseven_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 25, [accuracy,accuracy], WEAPON_FIVESEVEN); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_ONEHAND, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_fiveseven.fire"); #endif diff --git a/src/shared/w_g3sg1.qc b/src/shared/w_g3sg1.qc index 5e222bc..3c187fd 100644 --- a/src/shared/w_g3sg1.qc +++ b/src/shared/w_g3sg1.qc @@ -140,9 +140,9 @@ w_g3sg1_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 80, [accuracy,accuracy], WEAPON_G3SG1); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_g3sg1.fire"); #endif diff --git a/src/shared/w_glock18.qc b/src/shared/w_glock18.qc index bf65117..a4e4062 100644 --- a/src/shared/w_glock18.qc +++ b/src/shared/w_glock18.qc @@ -182,9 +182,9 @@ w_glock18_primary(void) View_AddEvent(w_pistol_ejectshell, 0.0f); #else if (pl.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_ONEHAND, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); if (pl.mode_glock18) { Sound_Play(pl, CHAN_WEAPON, "weapon_glock18.burstfire"); diff --git a/src/shared/w_knife.qc b/src/shared/w_knife.qc index 62ddb3b..2c824d8 100644 --- a/src/shared/w_knife.qc +++ b/src/shared/w_knife.qc @@ -114,9 +114,9 @@ w_knife_primary(void) Sound_Play(pl, CHAN_WEAPON, "weapon_knife.miss"); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_KNIFE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_KNIFE, 1.33f); else - Animation_PlayerTopTemp(ANIM_SHOOT_KNIFE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_KNIFE, 1.33f); if (trace_fraction >= 1.0) { return; diff --git a/src/shared/w_m3.qc b/src/shared/w_m3.qc index 8f2cf66..5787d4f 100644 --- a/src/shared/w_m3.qc +++ b/src/shared/w_m3.qc @@ -186,9 +186,9 @@ w_m3_primary(void) TraceAttack_FireBullets(9, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_M3); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_SHOTGUN, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_SHOTGUN, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_SHOTGUN, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_SHOTGUN, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_m3.fire"); #endif diff --git a/src/shared/w_m4a1.qc b/src/shared/w_m4a1.qc index 9a8050d..f795d25 100644 --- a/src/shared/w_m4a1.qc +++ b/src/shared/w_m4a1.qc @@ -187,9 +187,9 @@ w_m4a1_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_M4A1); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); #endif pl.w_attack_next = 0.0875f; diff --git a/src/shared/w_mac10.qc b/src/shared/w_mac10.qc index e2bfa06..2a8087c 100644 --- a/src/shared/w_mac10.qc +++ b/src/shared/w_mac10.qc @@ -144,9 +144,9 @@ w_mac10_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 29, [accuracy,accuracy], WEAPON_MAC10); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_MP5, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_MP5, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_mac10.fire"); #endif diff --git a/src/shared/w_mp5.qc b/src/shared/w_mp5.qc index dd991e0..b98e631 100644 --- a/src/shared/w_mp5.qc +++ b/src/shared/w_mp5.qc @@ -144,9 +144,9 @@ w_mp5_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_MP5); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_MP5, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_MP5, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.fire"); #endif diff --git a/src/shared/w_p228.qc b/src/shared/w_p228.qc index 8cbd07b..638cfcb 100644 --- a/src/shared/w_p228.qc +++ b/src/shared/w_p228.qc @@ -152,9 +152,9 @@ w_p228_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [accuracy,accuracy], WEAPON_P228); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_ONEHAND, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_p228.fire"); #endif diff --git a/src/shared/w_p90.qc b/src/shared/w_p90.qc index 596183e..4858203 100644 --- a/src/shared/w_p90.qc +++ b/src/shared/w_p90.qc @@ -144,9 +144,9 @@ w_p90_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_P90); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_MP5, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_MP5, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_p90.fire"); #endif diff --git a/src/shared/w_para.qc b/src/shared/w_para.qc index d669052..a07db22 100644 --- a/src/shared/w_para.qc +++ b/src/shared/w_para.qc @@ -140,9 +140,9 @@ w_para_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 35, [accuracy,accuracy], WEAPON_PARA); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_PARA, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_PARA, 0.45f); else - Animation_PlayerTopTemp(ANIM_SHOOT_PARA, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_PARA, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_para.fire"); #endif diff --git a/src/shared/w_scout.qc b/src/shared/w_scout.qc index 5c0fd02..ee32b0f 100644 --- a/src/shared/w_scout.qc +++ b/src/shared/w_scout.qc @@ -197,9 +197,9 @@ w_scout_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 75, [accuracy,accuracy], WEAPON_SCOUT); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_scout.fire"); #endif diff --git a/src/shared/w_sg550.qc b/src/shared/w_sg550.qc index 279e6a5..bc72939 100644 --- a/src/shared/w_sg550.qc +++ b/src/shared/w_sg550.qc @@ -140,9 +140,9 @@ w_sg550_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 70, [accuracy,accuracy], WEAPON_SG550); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_sg550.fire"); #endif diff --git a/src/shared/w_sg552.qc b/src/shared/w_sg552.qc index 7dfc91d..49659eb 100644 --- a/src/shared/w_sg552.qc +++ b/src/shared/w_sg552.qc @@ -144,9 +144,9 @@ w_sg552_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_SG552); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_RIFLE, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_RIFLE, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_RIFLE, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_sg552.fire"); #endif diff --git a/src/shared/w_tmp.qc b/src/shared/w_tmp.qc index f5508af..b059fce 100644 --- a/src/shared/w_tmp.qc +++ b/src/shared/w_tmp.qc @@ -146,9 +146,9 @@ w_tmp_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 26, [accuracy,accuracy], WEAPON_TMP); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_MP5, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_MP5, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_tmp.fire"); #endif diff --git a/src/shared/w_ump45.qc b/src/shared/w_ump45.qc index 3507c61..78c01a2 100644 --- a/src/shared/w_ump45.qc +++ b/src/shared/w_ump45.qc @@ -146,9 +146,9 @@ w_ump45_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 30, [accuracy,accuracy], WEAPON_UMP45); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_MP5, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_MP5, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_MP5, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_ump45.fire"); #endif diff --git a/src/shared/w_usp45.qc b/src/shared/w_usp45.qc index d1a3540..aff5f63 100644 --- a/src/shared/w_usp45.qc +++ b/src/shared/w_usp45.qc @@ -204,9 +204,9 @@ w_usp45_primary(void) TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 33, [accuracy,accuracy], WEAPON_USP45); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_ONEHAND, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_ONEHAND, 0.45f); #endif pl.gflags |= GF_SEMI_TOGGLED; diff --git a/src/shared/w_xm1014.qc b/src/shared/w_xm1014.qc index bfba027..c9cfbe3 100644 --- a/src/shared/w_xm1014.qc +++ b/src/shared/w_xm1014.qc @@ -186,9 +186,9 @@ w_xm1014_primary(void) TraceAttack_FireBullets(6, pl.origin + pl.view_ofs, 22, [accuracy,accuracy], WEAPON_XM1014); if (self.flags & FL_CROUCHING) - Animation_PlayerTopTemp(ANIM_SHOOT_SHOTGUN, 0.45f); + Animation_PlayerTop(pl, ANIM_SHOOT_SHOTGUN, 0.45f); else - Animation_PlayerTopTemp(ANIM_CROUCH_SHOOT_SHOTGUN, 0.45f); + Animation_PlayerTop(pl, ANIM_CROUCH_SHOOT_SHOTGUN, 0.45f); Sound_Play(pl, CHAN_WEAPON, "weapon_xm1014.fire"); #endif