Shared: Inherit weapon_common from Nuclide's base game. Optimise prediction
attribute code with macros.
This commit is contained in:
parent
7670300133
commit
22a1a70394
16 changed files with 228 additions and 230 deletions
|
@ -19,10 +19,10 @@ ClientGame_EntityUpdate(float id, float new)
|
|||
{
|
||||
switch (id) {
|
||||
default:
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -121,11 +121,11 @@ HUD_InSlotPos(int slot, int pos)
|
|||
if (pl.g_items & g_weapons[i].id) {
|
||||
return i;
|
||||
} else {
|
||||
return -1;
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -119,8 +119,8 @@ HLMultiplayerRules::ConsoleCommand(base_player pp, string cmd)
|
|||
Bot_AddQuick();
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#includelist
|
||||
../../../valve/src/shared/flags.h
|
||||
player.qc
|
||||
../../../valve/src/shared/weapon_common.h
|
||||
../../../base/src/shared/weapon_common.h
|
||||
../../../valve/src/shared/animations.h
|
||||
../../../valve/src/shared/animations.qc
|
||||
../../../valve/src/shared/pmove.qc
|
||||
|
@ -26,6 +26,6 @@ w_dml.qc
|
|||
w_minigun.qc
|
||||
w_aicore.qc
|
||||
weapons.qc
|
||||
../../../valve/src/shared/weapon_common.qc
|
||||
../../../base/src/shared/weapon_common.qc
|
||||
input.qc
|
||||
#endlist
|
||||
|
|
|
@ -18,15 +18,20 @@ void
|
|||
Game_Input(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
if (input_buttons & INPUT_BUTTON5) {
|
||||
Player_UseDown();
|
||||
} else {
|
||||
Player_UseUp();
|
||||
CGameRules rules = (CGameRules)g_grMode;
|
||||
|
||||
if (rules.m_iIntermission) {
|
||||
rules.IntermissionEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.impulse == 100) {
|
||||
if (input_buttons & INPUT_BUTTON5)
|
||||
Player_UseDown();
|
||||
else
|
||||
Player_UseUp();
|
||||
|
||||
if (self.impulse == 100)
|
||||
Flashlight_Toggle();
|
||||
}
|
||||
|
||||
if (cvar("sv_cheats") == 1) {
|
||||
player pl = (player)self;
|
||||
|
@ -43,27 +48,17 @@ Game_Input(void)
|
|||
Weapons_AddItem(pl, WEAPON_SHOTGUN, -1);
|
||||
Weapons_AddItem(pl, WEAPON_GRENADE, -1);
|
||||
}
|
||||
|
||||
if (self.impulse == 102) {
|
||||
// Respawn all the entities
|
||||
for (entity a = world; (a = findfloat(a, ::identity, 1));) {
|
||||
CBaseEntity caw = (CBaseEntity)a;
|
||||
caw.Respawn();
|
||||
}
|
||||
bprint(PRINT_HIGH, "Respawning all map entities...\n");
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
#endif
|
||||
|
||||
if (input_buttons & INPUT_BUTTON0) {
|
||||
if (input_buttons & INPUT_BUTTON0)
|
||||
Weapons_Primary();
|
||||
} else if (input_buttons & INPUT_BUTTON4) {
|
||||
else if (input_buttons & INPUT_BUTTON4)
|
||||
Weapons_Reload();
|
||||
} else if (input_buttons & INPUT_BUTTON3) {
|
||||
else if (input_buttons & INPUT_BUTTON3)
|
||||
Weapons_Secondary();
|
||||
} else {
|
||||
else
|
||||
Weapons_Release();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,41 +45,40 @@ enumflags
|
|||
noref int input_sequence;
|
||||
class player:base_player
|
||||
{
|
||||
/* Weapon specific */
|
||||
int ammo_battery; int ammo_battery_net; // beamgun
|
||||
int ammo_chem; int ammo_chem_net; // chemicalgun
|
||||
int ammo_rocket; int ammo_rocket_net; // dml / grenades
|
||||
int ammo_gauss; int ammo_gauss_net; // gauspistol
|
||||
int ammo_minigun; int ammo_minigun_net; // minigun
|
||||
int ammo_buckshot; int ammo_buckshot_net; // shotgun
|
||||
int fist_mode; int fist_mode_net; // knife/fists
|
||||
int gauss_mode; int gauss_mode_net;
|
||||
int shotgun_shells; int shotgun_shells_net;
|
||||
int shotgun_spread; int shotgun_spread_net;
|
||||
PREDICTED_INT(anim_top);
|
||||
PREDICTED_FLOAT(anim_top_time);
|
||||
PREDICTED_FLOAT(anim_top_delay);
|
||||
PREDICTED_INT(anim_bottom);
|
||||
PREDICTED_FLOAT(anim_bottom_time);
|
||||
|
||||
PREDICTED_INT(ammo_battery); /* beamgun */
|
||||
PREDICTED_INT(ammo_chem); /* chemicalgun */
|
||||
PREDICTED_INT(ammo_rocket); /* dml / grenades */
|
||||
PREDICTED_INT(ammo_gauss); /* gauspistol */
|
||||
PREDICTED_INT(ammo_minigun); /* minigun */
|
||||
PREDICTED_INT(ammo_buckshot); /* shotgun */
|
||||
PREDICTED_INT(fist_mode); /* knife/fists */
|
||||
PREDICTED_INT(gauss_mode);
|
||||
PREDICTED_INT(shotgun_shells);
|
||||
PREDICTED_INT(shotgun_spread);
|
||||
|
||||
int dml_launch; int dml_launch_net; /* when fired, when targeted */
|
||||
int dml_flightpath; int dml_flightpath_net; /* guided, homing, spiral */
|
||||
int dml_detonate; int dml_detonate_net; /* on impact, in proximity, timed, when tripped */
|
||||
int dml_payload; int dml_payload_net; /* explosive, cluster */
|
||||
int chem_acid; int chem_acid_net;
|
||||
int chem_neutral; int chem_neutral_net;
|
||||
int chem_base; int chem_base_net;
|
||||
int chem_pressure; int chem_pressure_net;
|
||||
PREDICTED_INT(dml_launch); /* when fired, when targeted */
|
||||
PREDICTED_INT(dml_flightpath); /* guided, homing, spiral */
|
||||
PREDICTED_INT(dml_detonate); /* on impact, in proximity, timed, when tripped */
|
||||
PREDICTED_INT(dml_payload); /* explosive, cluster */
|
||||
PREDICTED_INT(chem_acid);
|
||||
PREDICTED_INT(chem_neutral);
|
||||
PREDICTED_INT(chem_base);
|
||||
PREDICTED_INT(chem_pressure);
|
||||
|
||||
int beam_range; int beam_range_net; /* TOUCH TAZER, SHORT TAZER, MEDIUM BEAM, LONG BEAM */
|
||||
int beam_poweracc; int beam_poweracc_net; /* LOW HIGHEST, MEDIUM HIGH, HIGH MEDIUM, HIGHEST LOW */
|
||||
int beam_lightning; int beam_lightning_net; /* BEAM, CHAIN, BALL */
|
||||
int gren_detonate; int gren_detonate_net; /* when tripped (tripmine), timed, on impact */
|
||||
int gren_payload; int gren_payload_net; /* cluster, explosive */
|
||||
PREDICTED_INT(beam_range); /* TOUCH TAZER, SHORT TAZER, MEDIUM BEAM, LONG BEAM */
|
||||
PREDICTED_INT(beam_poweracc); /* LOW HIGHEST, MEDIUM HIGH, HIGH MEDIUM, HIGHEST LOW */
|
||||
PREDICTED_INT(beam_lightning); /* BEAM, CHAIN, BALL */
|
||||
PREDICTED_INT(gren_detonate); /* when tripped (tripmine), timed, on impact */
|
||||
PREDICTED_INT(gren_payload); /* cluster, explosive */
|
||||
|
||||
int menu_active; int menu_active_net;
|
||||
int dml_state; int dml_state_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;
|
||||
PREDICTED_INT(menu_active);
|
||||
PREDICTED_INT(dml_state);
|
||||
|
||||
#ifdef CLIENT
|
||||
/* External model */
|
||||
|
@ -176,39 +175,40 @@ player::PredictPreFrame(void)
|
|||
{
|
||||
base_player::PredictPreFrame();
|
||||
|
||||
ammo_battery_net = ammo_battery; // beamgun
|
||||
ammo_chem_net = ammo_chem; // chemicalgun
|
||||
ammo_rocket_net = ammo_rocket; // dml / grenades
|
||||
ammo_gauss_net = ammo_gauss; // gauspistol
|
||||
ammo_minigun_net = ammo_minigun; // minigun
|
||||
ammo_buckshot_net = ammo_buckshot; // shotgun
|
||||
fist_mode_net = fist_mode; // knife/fists
|
||||
gauss_mode_net = gauss_mode;
|
||||
shotgun_shells_net = shotgun_shells;
|
||||
shotgun_spread_net = shotgun_spread;
|
||||
|
||||
dml_launch_net = dml_launch; /* when fired, when targeted */
|
||||
dml_flightpath_net = dml_flightpath; /* guided, homing, spiral */
|
||||
dml_detonate_net = dml_detonate; /* on impact, in proximity, timed, when tripped */
|
||||
dml_payload_net = dml_payload; /* explosive, cluster */
|
||||
chem_acid_net = chem_acid;
|
||||
chem_neutral_net = chem_neutral;
|
||||
chem_base_net = chem_base;
|
||||
chem_pressure_net = chem_pressure;
|
||||
SAVE_STATE(anim_top);
|
||||
SAVE_STATE(anim_top_time);
|
||||
SAVE_STATE(anim_top_delay);
|
||||
SAVE_STATE(anim_bottom);
|
||||
SAVE_STATE(anim_bottom_time);
|
||||
|
||||
beam_range_net = beam_range; /* TOUCH TAZER, SHORT TAZER, MEDIUM BEAM, LONG BEAM */
|
||||
beam_poweracc_net = beam_poweracc; /* LOW HIGHEST, MEDIUM HIGH, HIGH MEDIUM, HIGHEST LOW */
|
||||
beam_lightning_net = beam_lightning; /* BEAM, CHAIN, BALL */
|
||||
gren_detonate_net = gren_detonate; /* when tripped (tripmine), timed, on impact */
|
||||
gren_payload_net = gren_payload; /* cluster, explosive */
|
||||
menu_active_net = menu_active;
|
||||
dml_state_net = dml_state;
|
||||
SAVE_STATE(ammo_battery);
|
||||
SAVE_STATE(ammo_chem);
|
||||
SAVE_STATE(ammo_rocket);
|
||||
SAVE_STATE(ammo_gauss);
|
||||
SAVE_STATE(ammo_minigun);
|
||||
SAVE_STATE(ammo_buckshot);
|
||||
SAVE_STATE(fist_mode);
|
||||
SAVE_STATE(gauss_mode);
|
||||
SAVE_STATE(shotgun_shells);
|
||||
SAVE_STATE(shotgun_spread);
|
||||
|
||||
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;
|
||||
SAVE_STATE(dml_launch);
|
||||
SAVE_STATE(dml_flightpath);
|
||||
SAVE_STATE(dml_detonate);
|
||||
SAVE_STATE(dml_payload);
|
||||
SAVE_STATE(chem_acid);
|
||||
SAVE_STATE(chem_neutral);
|
||||
SAVE_STATE(chem_base);
|
||||
SAVE_STATE(chem_pressure);
|
||||
|
||||
SAVE_STATE(beam_range);
|
||||
SAVE_STATE(beam_poweracc);
|
||||
SAVE_STATE(beam_lightning);
|
||||
SAVE_STATE(gren_detonate);
|
||||
SAVE_STATE(gren_payload);
|
||||
|
||||
SAVE_STATE(menu_active);
|
||||
SAVE_STATE(dml_state);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -223,38 +223,40 @@ player::PredictPostFrame(void)
|
|||
{
|
||||
base_player::PredictPostFrame();
|
||||
|
||||
ammo_battery = ammo_battery_net; // beamgun
|
||||
ammo_chem = ammo_chem_net; // chemicalgun
|
||||
ammo_rocket = ammo_rocket_net; // dml / grenades
|
||||
ammo_gauss = ammo_gauss_net; // gauspistol
|
||||
ammo_minigun = ammo_minigun_net; // minigun
|
||||
ammo_buckshot = ammo_buckshot_net; // shotgun
|
||||
fist_mode = fist_mode_net; // knife/fists
|
||||
gauss_mode = gauss_mode_net;
|
||||
shotgun_shells = shotgun_shells_net;
|
||||
shotgun_spread = shotgun_spread_net;
|
||||
|
||||
dml_launch = dml_launch_net; /* when fired, when targeted */
|
||||
dml_flightpath = dml_flightpath_net; /* guided, homing, spiral */
|
||||
dml_detonate = dml_detonate_net; /* on impact, in proximity, timed, when tripped */
|
||||
dml_payload = dml_payload_net; /* explosive, cluster */
|
||||
chem_acid = chem_acid_net;
|
||||
chem_neutral = chem_neutral_net;
|
||||
chem_base = chem_base_net;
|
||||
chem_pressure = chem_pressure_net;
|
||||
ROLL_BACK(anim_top);
|
||||
ROLL_BACK(anim_top_time);
|
||||
ROLL_BACK(anim_top_delay);
|
||||
ROLL_BACK(anim_bottom);
|
||||
ROLL_BACK(anim_bottom_time);
|
||||
|
||||
beam_range = beam_range_net; /* TOUCH TAZER, SHORT TAZER, MEDIUM BEAM, LONG BEAM */
|
||||
beam_poweracc = beam_poweracc_net; /* LOW HIGHEST, MEDIUM HIGH, HIGH MEDIUM, HIGHEST LOW */
|
||||
beam_lightning = beam_lightning_net; /* BEAM, CHAIN, BALL */
|
||||
gren_detonate = gren_detonate_net; /* when tripped (tripmine), timed, on impact */
|
||||
gren_payload = gren_payload_net; /* cluster, explosive */
|
||||
menu_active = menu_active_net;
|
||||
ROLL_BACK(ammo_battery);
|
||||
ROLL_BACK(ammo_chem);
|
||||
ROLL_BACK(ammo_rocket);
|
||||
ROLL_BACK(ammo_gauss);
|
||||
ROLL_BACK(ammo_minigun);
|
||||
ROLL_BACK(ammo_buckshot);
|
||||
ROLL_BACK(fist_mode);
|
||||
ROLL_BACK(gauss_mode);
|
||||
ROLL_BACK(shotgun_shells);
|
||||
ROLL_BACK(shotgun_spread);
|
||||
|
||||
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;
|
||||
ROLL_BACK(dml_launch);
|
||||
ROLL_BACK(dml_flightpath);
|
||||
ROLL_BACK(dml_detonate);
|
||||
ROLL_BACK(dml_payload);
|
||||
ROLL_BACK(chem_acid);
|
||||
ROLL_BACK(chem_neutral);
|
||||
ROLL_BACK(chem_base);
|
||||
ROLL_BACK(chem_pressure);
|
||||
|
||||
ROLL_BACK(beam_range);
|
||||
ROLL_BACK(beam_poweracc);
|
||||
ROLL_BACK(beam_lightning);
|
||||
ROLL_BACK(gren_detonate);
|
||||
ROLL_BACK(gren_payload);
|
||||
|
||||
ROLL_BACK(menu_active);
|
||||
ROLL_BACK(dml_state);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -264,98 +266,99 @@ player::EvaluateEntity(void)
|
|||
base_player::EvaluateEntity();
|
||||
|
||||
/* animation */
|
||||
if (anim_bottom_net != anim_bottom || anim_bottom_time != anim_bottom_time_net)
|
||||
if (ATTR_CHANGED(anim_bottom) || ATTR_CHANGED(anim_bottom_time))
|
||||
SendFlags |= PLAYER_BOTTOMFRAME;
|
||||
if (anim_top_net != anim_top || anim_top_time != anim_top_time_net || anim_top_delay != anim_top_delay_net)
|
||||
if (ATTR_CHANGED(anim_top) || ATTR_CHANGED(anim_top_time) || ATTR_CHANGED(anim_top_delay))
|
||||
SendFlags |= PLAYER_TOPFRAME;
|
||||
|
||||
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;
|
||||
|
||||
/* ammo 1 type updates */
|
||||
if (ammo_battery_net == ammo_battery)
|
||||
if (ATTR_CHANGED(ammo_battery))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (ammo_chem_net == ammo_chem)
|
||||
if (ATTR_CHANGED(ammo_chem))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (ammo_rocket_net == ammo_rocket)
|
||||
if (ATTR_CHANGED(ammo_rocket))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (ammo_gauss_net == ammo_gauss)
|
||||
if (ATTR_CHANGED(ammo_gauss))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (ammo_minigun_net == ammo_minigun)
|
||||
if (ATTR_CHANGED(ammo_minigun))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (ammo_buckshot_net == ammo_buckshot)
|
||||
if (ATTR_CHANGED(ammo_buckshot))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (fist_mode_net == fist_mode)
|
||||
if (ATTR_CHANGED(fist_mode))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (gauss_mode_net == gauss_mode)
|
||||
if (ATTR_CHANGED(gauss_mode))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (shotgun_shells_net == shotgun_shells)
|
||||
if (ATTR_CHANGED(shotgun_shells))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
if (shotgun_spread_net == shotgun_spread)
|
||||
if (ATTR_CHANGED(shotgun_spread))
|
||||
SendFlags |= PLAYER_AMMO1;
|
||||
|
||||
if (dml_launch_net == dml_launch)
|
||||
if (ATTR_CHANGED(dml_launch))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (dml_flightpath_net == dml_flightpath)
|
||||
if (ATTR_CHANGED(dml_flightpath))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (dml_detonate_net == dml_detonate)
|
||||
if (ATTR_CHANGED(dml_detonate))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (dml_payload_net == dml_payload)
|
||||
if (ATTR_CHANGED(dml_payload))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (chem_acid_net == chem_acid)
|
||||
if (ATTR_CHANGED(chem_acid))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (chem_neutral_net == chem_neutral)
|
||||
if (ATTR_CHANGED(chem_neutral))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (chem_base_net == chem_base)
|
||||
if (ATTR_CHANGED(chem_base))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
if (chem_pressure_net == chem_pressure)
|
||||
if (ATTR_CHANGED(chem_pressure))
|
||||
SendFlags |= PLAYER_AMMO2;
|
||||
|
||||
if (beam_range_net == beam_range)
|
||||
if (ATTR_CHANGED(beam_range))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (beam_poweracc_net == beam_poweracc)
|
||||
if (ATTR_CHANGED(beam_poweracc))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (beam_lightning_net == beam_lightning)
|
||||
if (ATTR_CHANGED(beam_lightning))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (gren_detonate_net == gren_detonate)
|
||||
if (ATTR_CHANGED(gren_detonate))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (gren_payload_net == gren_payload)
|
||||
if (ATTR_CHANGED(gren_payload))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (menu_active_net == menu_active)
|
||||
if (ATTR_CHANGED(menu_active))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
if (dml_state_net == dml_state)
|
||||
if (ATTR_CHANGED(dml_state))
|
||||
SendFlags |= PLAYER_AMMO3;
|
||||
|
||||
ammo_battery_net = ammo_battery;
|
||||
ammo_chem_net = ammo_chem;
|
||||
ammo_rocket_net = ammo_rocket;
|
||||
ammo_gauss_net = ammo_gauss;
|
||||
ammo_minigun_net = ammo_minigun;
|
||||
ammo_buckshot_net = ammo_buckshot;
|
||||
fist_mode_net = fist_mode;
|
||||
gauss_mode_net = gauss_mode;
|
||||
shotgun_shells_net = shotgun_shells;
|
||||
shotgun_spread_net = shotgun_spread;
|
||||
|
||||
dml_launch_net = dml_launch;
|
||||
dml_flightpath_net = dml_flightpath;
|
||||
dml_detonate_net = dml_detonate;
|
||||
dml_payload_net = dml_payload;
|
||||
chem_acid_net = chem_acid;
|
||||
chem_neutral_net = chem_neutral;
|
||||
chem_base_net = chem_base;
|
||||
chem_pressure_net = chem_pressure;
|
||||
SAVE_STATE(anim_top);
|
||||
SAVE_STATE(anim_top_time);
|
||||
SAVE_STATE(anim_top_delay);
|
||||
SAVE_STATE(anim_bottom);
|
||||
SAVE_STATE(anim_bottom_time);
|
||||
|
||||
beam_range_net = beam_range;
|
||||
beam_poweracc_net = beam_poweracc;
|
||||
beam_lightning_net = beam_lightning;
|
||||
gren_detonate_net = gren_detonate;
|
||||
gren_payload_net = gren_payload;
|
||||
menu_active_net = menu_active;
|
||||
dml_state_net = dml_state;
|
||||
SAVE_STATE(ammo_battery);
|
||||
SAVE_STATE(ammo_chem);
|
||||
SAVE_STATE(ammo_rocket);
|
||||
SAVE_STATE(ammo_gauss);
|
||||
SAVE_STATE(ammo_minigun);
|
||||
SAVE_STATE(ammo_buckshot);
|
||||
SAVE_STATE(fist_mode);
|
||||
SAVE_STATE(gauss_mode);
|
||||
SAVE_STATE(shotgun_shells);
|
||||
SAVE_STATE(shotgun_spread);
|
||||
|
||||
SAVE_STATE(dml_launch);
|
||||
SAVE_STATE(dml_flightpath);
|
||||
SAVE_STATE(dml_detonate);
|
||||
SAVE_STATE(dml_payload);
|
||||
SAVE_STATE(chem_acid);
|
||||
SAVE_STATE(chem_neutral);
|
||||
SAVE_STATE(chem_base);
|
||||
SAVE_STATE(chem_pressure);
|
||||
|
||||
SAVE_STATE(beam_range);
|
||||
SAVE_STATE(beam_poweracc);
|
||||
SAVE_STATE(beam_lightning);
|
||||
SAVE_STATE(gren_detonate);
|
||||
SAVE_STATE(gren_payload);
|
||||
|
||||
SAVE_STATE(menu_active);
|
||||
SAVE_STATE(dml_state);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -367,11 +370,11 @@ float
|
|||
player::SendEntity(entity ePEnt, float fChanged)
|
||||
{
|
||||
if (health <= 0 && ePEnt != this) {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (clienttype(ePEnt) != CLIENTTYPE_REAL) {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (ePEnt != self) {
|
||||
|
@ -433,6 +436,6 @@ player::SendEntity(entity ePEnt, float fChanged)
|
|||
WriteByte(MSG_ENTITY, dml_state);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -95,7 +95,7 @@ w_aicore_deathmsg(void)
|
|||
float
|
||||
w_aicore_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -137,7 +137,7 @@ w_beamgun_deathmsg(void)
|
|||
float
|
||||
w_beamgun_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -289,7 +289,7 @@ int
|
|||
w_beamgun_hudforward(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -303,14 +303,14 @@ w_beamgun_hudforward(player pl)
|
|||
sendevent("w_beamgun_light", "i", 1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
w_beamgun_hudback(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -324,7 +324,7 @@ w_beamgun_hudback(player pl)
|
|||
sendevent("w_beamgun_light", "i", -1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -133,7 +133,7 @@ w_chemicalgun_deathmsg(void)
|
|||
float
|
||||
w_chemicalgun_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -152,10 +152,10 @@ w_chemicalgun_pickup(int new, int startammo)
|
|||
if (pl.ammo_chem < 50) {
|
||||
pl.ammo_chem = bound(0, pl.ammo_chem + 10, 50);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
|
@ -391,7 +391,7 @@ int
|
|||
w_chemgun_hudforward(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -408,14 +408,14 @@ w_chemgun_hudforward(player pl)
|
|||
sendevent("w_chem_p", "i", 1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
w_chemgun_hudback(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -432,7 +432,7 @@ w_chemgun_hudback(player pl)
|
|||
sendevent("w_chem_p", "i", -1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -218,7 +218,7 @@ w_dml_deathmsg(void)
|
|||
float
|
||||
w_dml_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -230,10 +230,10 @@ w_dml_pickup(int new, int startammo)
|
|||
if (pl.ammo_rocket < 100) {
|
||||
pl.ammo_rocket = bound(0, pl.ammo_rocket + 2, 100);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -411,7 +411,7 @@ int
|
|||
w_dml_hudforward(player pl)
|
||||
{
|
||||
if (pl.menu_active <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.menu_active) {
|
||||
|
@ -428,13 +428,13 @@ w_dml_hudforward(player pl)
|
|||
sendevent("w_dml_pay", "i", 1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
int
|
||||
w_dml_hudback(player pl)
|
||||
{
|
||||
if (pl.menu_active <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.menu_active) {
|
||||
|
@ -451,7 +451,7 @@ w_dml_hudback(player pl)
|
|||
sendevent("w_dml_pay", "i", -1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -217,7 +217,7 @@ w_fists_deathmsg(void)
|
|||
float
|
||||
w_fists_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -229,10 +229,10 @@ w_fists_pickup(int new, int startammo)
|
|||
if (pl.ammo_minigun < 100) {
|
||||
pl.ammo_minigun = bound(0, pl.ammo_minigun + 30, 100);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -193,7 +193,7 @@ w_gausspistol_deathmsg(void)
|
|||
float
|
||||
w_gausspistol_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -205,10 +205,10 @@ w_gausspistol_pickup(int new, int startammo)
|
|||
if (pl.ammo_gauss < 150) {
|
||||
pl.ammo_gauss = bound(0, pl.ammo_gauss + 35, 150);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -399,24 +399,24 @@ int
|
|||
w_gausspistol_hudforward(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
pl.a_ammo3 = bound(GM_SINGLE, pl.a_ammo3 - 1, GM_FAST);
|
||||
sendevent("w_gp_setmode", "i", pl.a_ammo3);
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
w_gausspistol_hudback(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
pl.a_ammo3 = bound(GM_SINGLE, pl.a_ammo3 + 1, GM_FAST);
|
||||
sendevent("w_gp_setmode", "i", pl.a_ammo3);
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -139,7 +139,7 @@ w_grenade_deathmsg(void)
|
|||
float
|
||||
w_grenade_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -253,7 +253,7 @@ int
|
|||
w_grenade_hudforward(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -264,14 +264,14 @@ w_grenade_hudforward(player pl)
|
|||
sendevent("w_gren_pay", "i", 1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
w_grenade_hudback(player pl)
|
||||
{
|
||||
if (pl.a_ammo1 <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.a_ammo1) {
|
||||
|
@ -282,7 +282,7 @@ w_grenade_hudback(player pl)
|
|||
sendevent("w_gren_pay", "i", -1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -168,7 +168,7 @@ w_minigun_deathmsg(void)
|
|||
float
|
||||
w_minigun_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -180,10 +180,10 @@ w_minigun_pickup(int new, int startammo)
|
|||
if (pl.ammo_minigun < 100) {
|
||||
pl.ammo_minigun = bound(0, pl.ammo_minigun + 30, 100);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -210,7 +210,7 @@ w_shotgun_deathmsg(void)
|
|||
float
|
||||
w_shotgun_aimanim(void)
|
||||
{
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -227,10 +227,10 @@ w_shotgun_pickup(int new, int startammo)
|
|||
if (pl.ammo_buckshot < 90) {
|
||||
pl.ammo_buckshot = bound(0, pl.ammo_buckshot + 16, 90);
|
||||
} else {
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -361,7 +361,7 @@ int
|
|||
w_shotgun_hudforward(player pl)
|
||||
{
|
||||
if (pl.menu_active <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.menu_active) {
|
||||
|
@ -372,14 +372,14 @@ w_shotgun_hudforward(player pl)
|
|||
sendevent("w_shot_spread", "i", 1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
w_shotgun_hudback(player pl)
|
||||
{
|
||||
if (pl.menu_active <= 0) {
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
switch (pl.menu_active) {
|
||||
|
@ -390,7 +390,7 @@ w_shotgun_hudback(player pl)
|
|||
sendevent("w_shot_spread", "i", -1i);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
return (0);
|
||||
}
|
||||
#else
|
||||
void
|
||||
|
|
|
@ -61,7 +61,7 @@ int Weapons_InputForward(player pl)
|
|||
if (gp_inputforward[pl.activeweapon] != __NULL__) {
|
||||
return gp_inputforward[pl.activeweapon](pl);
|
||||
}
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
|
||||
int Weapons_InputBack(player pl)
|
||||
|
@ -69,6 +69,6 @@ int Weapons_InputBack(player pl)
|
|||
if (gp_inputback[pl.activeweapon] != __NULL__) {
|
||||
return gp_inputback[pl.activeweapon](pl);
|
||||
}
|
||||
return TRUE;
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue