Handle player weapon model attachments for all the weapons!

This commit is contained in:
Marco Cawthorne 2021-04-06 09:20:35 +02:00
parent dee6ee1a73
commit cc48c2c994
30 changed files with 174 additions and 207 deletions

View file

@ -27,3 +27,8 @@ ClientGame_EntityUpdate(float id, float new)
return TRUE;
}
void
ClientGame_EntityRemove(void)
{
}

View file

@ -1,44 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
*
* 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);
}
}
}

View file

@ -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

View file

@ -37,7 +37,6 @@ CSGameRules::BuyingPossible(base_player pl)
void
CSGameRules::PlayerPostFrame(base_player pp)
{
Animation_PlayerUpdate();
}
void

View file

@ -113,5 +113,3 @@ enum
ANIM_CROUCH_DIE
};
void Animation_PlayerTop(float);
void Animation_PlayerTopTemp(float, float);

View file

@ -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;
}

View file

@ -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);

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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");

View file

@ -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

View file

@ -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

View file

@ -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");

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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