Fix the code against the latest Nuclide.
This commit is contained in:
parent
c7986d7d59
commit
0bb992d592
8 changed files with 66 additions and 72 deletions
|
@ -12,7 +12,7 @@ player.qc
|
||||||
../../../valve/src/shared/fx_breakmodel.qc
|
../../../valve/src/shared/fx_breakmodel.qc
|
||||||
../../../valve/src/shared/fx_explosion.qc
|
../../../valve/src/shared/fx_explosion.qc
|
||||||
../../../valve/src/shared/fx_gibhuman.qc
|
../../../valve/src/shared/fx_gibhuman.qc
|
||||||
../../../valve/src/shared/fx_spark.qc
|
../../../base/src/shared/fx_spark.qc
|
||||||
../../../valve/src/shared/fx_impact.qc
|
../../../valve/src/shared/fx_impact.qc
|
||||||
|
|
||||||
items.h
|
items.h
|
||||||
|
|
|
@ -33,8 +33,8 @@ enumflags
|
||||||
PLAYER_ARMOR,
|
PLAYER_ARMOR,
|
||||||
PLAYER_MOVETYPE,
|
PLAYER_MOVETYPE,
|
||||||
PLAYER_VIEWOFS,
|
PLAYER_VIEWOFS,
|
||||||
PLAYER_BASEFRAME,
|
PLAYER_TOPFRAME,
|
||||||
PLAYER_FRAME,
|
PLAYER_BOTTOMFRAME,
|
||||||
PLAYER_AMMO1,
|
PLAYER_AMMO1,
|
||||||
PLAYER_AMMO2,
|
PLAYER_AMMO2,
|
||||||
PLAYER_AMMO3,
|
PLAYER_AMMO3,
|
||||||
|
@ -42,45 +42,6 @@ enumflags
|
||||||
PLAYER_UNUSED2
|
PLAYER_UNUSED2
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ammo 1 type updates */
|
|
||||||
enumflags
|
|
||||||
{
|
|
||||||
AMMO1_GLOCK,
|
|
||||||
AMMO1_MP5,
|
|
||||||
AMMO1_PYTHON,
|
|
||||||
AMMO1_SHOTGUN,
|
|
||||||
AMMO1_CROSSBOW,
|
|
||||||
AMMO1_RPG,
|
|
||||||
AMMO1_SATCHEL
|
|
||||||
};
|
|
||||||
|
|
||||||
/* ammo 2 type updates */
|
|
||||||
enumflags
|
|
||||||
{
|
|
||||||
AMMO2_9MM,
|
|
||||||
AMMO2_357,
|
|
||||||
AMMO2_BUCKSHOT,
|
|
||||||
AMMO2_BOLT,
|
|
||||||
AMMO2_ROCKET,
|
|
||||||
AMMO2_URANIUM,
|
|
||||||
AMMO2_HANDGRENADE,
|
|
||||||
AMMO2_SATCHEL,
|
|
||||||
AMMO2_TRIPMINE,
|
|
||||||
AMMO2_SNARK,
|
|
||||||
AMMO2_HORNET,
|
|
||||||
};
|
|
||||||
|
|
||||||
enumflags
|
|
||||||
{
|
|
||||||
AMMO3_M203_GRENADE,
|
|
||||||
AMMO3_SHOTGUN_STATE,
|
|
||||||
AMMO3_GAUSS_STATE,
|
|
||||||
AMMO3_GAUSS_VOLUME,
|
|
||||||
AMMO3_EGON_STATE,
|
|
||||||
AMMO3_RPG_STATE,
|
|
||||||
AMMO3_HANDGRENADE_STATE
|
|
||||||
};
|
|
||||||
|
|
||||||
noref int input_sequence;
|
noref int input_sequence;
|
||||||
class player:base_player
|
class player:base_player
|
||||||
{
|
{
|
||||||
|
@ -152,6 +113,12 @@ class player:base_player
|
||||||
int ammo_gas; int ammo_gas_net;
|
int ammo_gas; int ammo_gas_net;
|
||||||
int mode_silencer; int mode_silencer_net;
|
int mode_silencer; int mode_silencer_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
|
#ifdef CLIENT
|
||||||
/* External model */
|
/* External model */
|
||||||
entity p_model;
|
entity p_model;
|
||||||
|
@ -159,7 +126,6 @@ class player:base_player
|
||||||
int p_model_bone;
|
int p_model_bone;
|
||||||
float lastweapon;
|
float lastweapon;
|
||||||
|
|
||||||
virtual void(void) gun_offset;
|
|
||||||
virtual void(void) draw;
|
virtual void(void) draw;
|
||||||
virtual float() predraw;
|
virtual float() predraw;
|
||||||
virtual void(void) postdraw;
|
virtual void(void) postdraw;
|
||||||
|
@ -235,12 +201,16 @@ player::ReceiveEntity(float new)
|
||||||
movetype = readbyte();
|
movetype = readbyte();
|
||||||
if (fl & PLAYER_VIEWOFS)
|
if (fl & PLAYER_VIEWOFS)
|
||||||
view_ofs[2] = readfloat();
|
view_ofs[2] = readfloat();
|
||||||
if (fl & PLAYER_BASEFRAME)
|
|
||||||
baseframe = readbyte();
|
/* animation */
|
||||||
if (fl & PLAYER_FRAME) {
|
if (fl & PLAYER_TOPFRAME) {
|
||||||
frame = readbyte();
|
anim_top = readbyte();
|
||||||
frame1time = 0.0f;
|
anim_top_time = readfloat();
|
||||||
frame2time = 0.0f;
|
anim_top_delay = readfloat();
|
||||||
|
}
|
||||||
|
if (fl & PLAYER_BOTTOMFRAME) {
|
||||||
|
anim_bottom = readbyte();
|
||||||
|
anim_bottom_time = readfloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fl & PLAYER_AMMO1) {
|
if (fl & PLAYER_AMMO1) {
|
||||||
|
@ -350,6 +320,12 @@ player::PredictPreFrame(void)
|
||||||
ammo_gas_net = ammo_gas;
|
ammo_gas_net = ammo_gas;
|
||||||
|
|
||||||
mode_silencer_net = mode_silencer;
|
mode_silencer_net = mode_silencer;
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -404,6 +380,12 @@ player::PredictPostFrame(void)
|
||||||
ammo_gas = ammo_gas_net;
|
ammo_gas = ammo_gas_net;
|
||||||
|
|
||||||
mode_silencer = mode_silencer_net;
|
mode_silencer = mode_silencer_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
|
#else
|
||||||
|
@ -466,11 +448,11 @@ player::EvaluateEntity(void)
|
||||||
if (old_viewofs != view_ofs[2])
|
if (old_viewofs != view_ofs[2])
|
||||||
SendFlags |= PLAYER_VIEWOFS;
|
SendFlags |= PLAYER_VIEWOFS;
|
||||||
|
|
||||||
if (old_baseframe != baseframe)
|
/* animation */
|
||||||
SendFlags |= PLAYER_BASEFRAME;
|
if (anim_bottom_net != anim_bottom || anim_bottom_time != anim_bottom_time_net)
|
||||||
|
SendFlags |= PLAYER_BOTTOMFRAME;
|
||||||
if (old_frame != frame)
|
if (anim_top_net != anim_top || anim_top_time != anim_top_time_net || anim_top_delay != anim_top_delay_net)
|
||||||
SendFlags |= PLAYER_FRAME;
|
SendFlags |= PLAYER_TOPFRAME;
|
||||||
|
|
||||||
/* ammo 1 type updates */
|
/* ammo 1 type updates */
|
||||||
if (glock_mag != glock_mag_net) {
|
if (glock_mag != glock_mag_net) {
|
||||||
|
@ -635,6 +617,12 @@ player::EvaluateEntity(void)
|
||||||
ammo_medkit_net = ammo_medkit;
|
ammo_medkit_net = ammo_medkit;
|
||||||
ammo_gas_net = ammo_gas;
|
ammo_gas_net = ammo_gas;
|
||||||
mode_silencer_net= mode_silencer;
|
mode_silencer_net= mode_silencer;
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -703,10 +691,16 @@ player::SendEntity(entity ePEnt, float fChanged)
|
||||||
WriteByte(MSG_ENTITY, movetype);
|
WriteByte(MSG_ENTITY, movetype);
|
||||||
if (fChanged & PLAYER_VIEWOFS)
|
if (fChanged & PLAYER_VIEWOFS)
|
||||||
WriteFloat(MSG_ENTITY, view_ofs[2]);
|
WriteFloat(MSG_ENTITY, view_ofs[2]);
|
||||||
if (fChanged & PLAYER_BASEFRAME)
|
|
||||||
WriteByte(MSG_ENTITY, baseframe);
|
if (fChanged & PLAYER_TOPFRAME) {
|
||||||
if (fChanged & PLAYER_FRAME)
|
WriteByte(MSG_ENTITY, anim_top);
|
||||||
WriteByte(MSG_ENTITY, frame);
|
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) {
|
if (fChanged & PLAYER_AMMO1) {
|
||||||
WriteByte(MSG_ENTITY, glock_mag);
|
WriteByte(MSG_ENTITY, glock_mag);
|
||||||
|
|
|
@ -137,9 +137,9 @@ w_ap9_primary(void)
|
||||||
Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
|
Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
|
||||||
|
|
||||||
if (self.flags & FL_CROUCHING)
|
if (self.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
|
||||||
else
|
else
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pl.w_attack_next = 0.15f;
|
pl.w_attack_next = 0.15f;
|
||||||
|
@ -182,9 +182,9 @@ w_ap9_secondary(void)
|
||||||
Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
|
Sound_Play(pl, CHAN_WEAPON, "weapon_ap9.fire");
|
||||||
|
|
||||||
if (self.flags & FL_CROUCHING)
|
if (self.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
|
||||||
else
|
else
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pl.w_attack_next = 1.0f;
|
pl.w_attack_next = 1.0f;
|
||||||
|
|
|
@ -117,9 +117,9 @@ w_medkit_primary(void)
|
||||||
Damage_Apply(pl, pl, -15, WEAPON_MEDKIT, DMG_GENERIC);
|
Damage_Apply(pl, pl, -15, WEAPON_MEDKIT, DMG_GENERIC);
|
||||||
|
|
||||||
if (self.flags & FL_CROUCHING)
|
if (self.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
|
||||||
else
|
else
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
|
||||||
|
|
||||||
Sound_Play(pl, CHAN_WEAPON, "weapon_medkit.heal");
|
Sound_Play(pl, CHAN_WEAPON, "weapon_medkit.heal");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -130,9 +130,9 @@ w_shovel_primary(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl.flags & FL_CROUCHING) {
|
if (pl.flags & FL_CROUCHING) {
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f);
|
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
|
||||||
} else {
|
} else {
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOTCROWBAR, 0.42f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.42f);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SERVER
|
#ifdef SERVER
|
||||||
|
|
|
@ -135,9 +135,9 @@ w_silencer_primary(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.flags & FL_CROUCHING)
|
if (self.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
|
||||||
else
|
else
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Fires faster without silencer */
|
/* Fires faster without silencer */
|
||||||
|
|
|
@ -104,9 +104,9 @@ w_spanner_primary(void)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (pl.flags & FL_CROUCHING) {
|
if (pl.flags & FL_CROUCHING) {
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOTCROWBAR, 0.5f);
|
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
|
||||||
} else {
|
} else {
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOTCROWBAR, 0.42f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.42f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.miss");
|
Sound_Play(self, CHAN_WEAPON, "weapon_crowbar.miss");
|
||||||
|
|
|
@ -132,9 +132,9 @@ w_taurus_primary(void)
|
||||||
Sound_Play(pl, CHAN_WEAPON, "weapon_taurus.fire");
|
Sound_Play(pl, CHAN_WEAPON, "weapon_taurus.fire");
|
||||||
|
|
||||||
if (self.flags & FL_CROUCHING)
|
if (self.flags & FL_CROUCHING)
|
||||||
Animation_PlayerTopTemp(ANIM_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.45f);
|
||||||
else
|
else
|
||||||
Animation_PlayerTopTemp(ANIM_CR_SHOOT1HAND, 0.45f);
|
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.45f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pl.w_attack_next = 0.25f;
|
pl.w_attack_next = 0.25f;
|
||||||
|
|
Loading…
Reference in a new issue