Clean up our player enumflags.

This commit is contained in:
Marco Cawthorne 2022-08-07 14:14:16 -07:00
parent b0dbd92aca
commit 8eb5a1fbc6
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
9 changed files with 28 additions and 37 deletions

View File

@ -1,4 +1,4 @@
#pragma target fte
#pragma target fte_6301
#pragma progs_dat "../../csprogs.dat"
#define CSQC

View File

@ -1,4 +1,4 @@
#pragma target fte_5768
#pragma target fte_6301
#pragma progs_dat "../../menu.dat"
#define MENU
#define GAME_DIR "valve"

View File

@ -1,4 +1,4 @@
CC=fteqcc
all:
$(CC) progs.src
$(CC) -fwasm progs.src

View File

@ -14,8 +14,8 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
var string autocvar_mp_teamlist = "robo;hgrunt";
const string mp_teamlist_fallback = "robo;hgrunt";
var string autocvar_mp_teamlist = mp_teamlist_fallback;
bool
HLMultiplayerRules::IsMultiplayer(void)

View File

@ -17,29 +17,14 @@
/* all potential SendFlags bits we can possibly send */
enumflags
{
PLAYER_KEEPALIVE,
PLAYER_MODELINDEX,
PLAYER_ORIGIN,
PLAYER_ORIGIN_Z,
PLAYER_ANGLES_X,
PLAYER_ANGLES_Y,
PLAYER_COLORMAP,
PLAYER_VELOCITY,
PLAYER_VELOCITY_Z,
PLAYER_FLAGS,
PLAYER_WEAPON,
PLAYER_ITEMS,
PLAYER_HEALTH,
PLAYER_ARMOR,
PLAYER_MOVETYPE,
PLAYER_VIEWOFS,
PLAYER_TOPFRAME,
PLAYER_TOPFRAME = PLAYER_CUSTOMFIELDSTART,
PLAYER_BOTTOMFRAME,
PLAYER_AMMO1,
PLAYER_AMMO2,
PLAYER_AMMO3,
PLAYER_UNUSED1,
PLAYER_UNUSED2
PLAYER_UNUSED5,
PLAYER_UNUSED6,
PLAYER_UNUSED7
};
class player:NSClientPlayer
@ -171,7 +156,7 @@ player::ReceiveEntity(float new, float fl)
HUD_AmmoNotify_Check(this);
}
if (fl & PLAYER_ITEMS || fl & PLAYER_HEALTH || fl & PLAYER_ARMOR)
if (fl & PLAYER_ITEMS || fl & PLAYER_HEALTH)
HUD_ItemNotify_Check(this);
}
@ -511,11 +496,14 @@ player::SendEntity(entity ePEnt, float fChanged)
if (ePEnt != self && ePEnt.classname != "spectator") {
fChanged &= ~PLAYER_ITEMS;
fChanged &= ~PLAYER_HEALTH;
fChanged &= ~PLAYER_ARMOR;
fChanged &= ~PLAYER_VIEWOFS;
fChanged &= ~PLAYER_TIMINGS;
fChanged &= ~PLAYER_AMMO1;
fChanged &= ~PLAYER_AMMO2;
fChanged &= ~PLAYER_AMMO3;
fChanged &= ~PLAYER_FLAGS;
fChanged &= ~PLAYER_PUNCHANGLE;
fChanged &= ~PLAYER_VIEWZOOM;
fChanged &= ~PLAYER_SPECTATE;
}
WriteByte(MSG_ENTITY, ENT_PLAYER);

View File

@ -68,18 +68,22 @@ void w_egon_precache(void)
w_egon_sparkframes[i] = spriteframe("sprites/xspark1.spr", i, 0.0f);
#endif
}
void w_egon_updateammo(player pl)
{
Weapons_UpdateAmmo(pl, -1, pl.ammo_uranium, -1);
}
string w_egon_wmodel(void)
{
return "models/w_egon.mdl";
}
string w_egon_pmodel(player pl)
{
return "models/p_egon.mdl";
}
string w_egon_deathmsg(void)
{
return "";
@ -88,7 +92,6 @@ string w_egon_deathmsg(void)
int w_egon_pickup(player pl, int new, int startammo)
{
#ifdef SERVER
if (pl.ammo_uranium < MAX_A_URANIUM) {
pl.ammo_uranium = bound(0, pl.ammo_uranium + 20, MAX_A_URANIUM);
} else {
@ -125,7 +128,8 @@ void w_egon_primary(player pl)
}
/* Ammo check */
if ((pl.ammo_uranium <= 0i) ? true : false || pl.WaterLevel() >= WATERLEVEL_SUBMERGED) {
bool out_of_ammo = (pl.ammo_uranium <= 0i) ? true : false;
if (out_of_ammo || pl.WaterLevel() >= WATERLEVEL_SUBMERGED) {
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_egon.empty");
#endif
@ -186,7 +190,6 @@ void w_egon_reload(player pl)
void w_egon_release(player pl)
{
if (pl.mode_tempstate != 0 && pl.mode_tempstate < 3) {
#ifdef SERVER
sound(pl, CHAN_WEAPON, "weapons/egon_off1.wav", 1, ATTN_NORM, 100, 0);
@ -223,7 +226,6 @@ void
w_egon_postdraw(player pl, int thirdperson)
{
#ifdef CLIENT
if (!(pl.gflags & GF_EGONBEAM))
return;
@ -304,7 +306,6 @@ void w_egon_hudpic(player pl, int selected, vector pos, float a)
int
w_egon_isempty(player pl)
{
if (pl.ammo_uranium <= 0)
return 1;

View File

@ -123,7 +123,6 @@ int
w_glock_pickup(player pl, int new, int startammo)
{
#ifdef SERVER
if (new) {
pl.glock_mag = 18;
return (1);
@ -244,7 +243,6 @@ w_glock_secondary(player pl)
void
w_glock_reload(player pl)
{
if (pl.w_attack_next > 0.0) {
return;
}
@ -394,7 +392,6 @@ w_glock_hudpic(player pl, int selected, vector pos, float a)
int
w_glock_isempty(player pl)
{
if (pl.glock_mag <= 0 && pl.ammo_9mm <= 0)
return 1;

View File

@ -45,18 +45,22 @@ void w_handgrenade_precache(void)
precache_model("models/p_grenade.mdl");
#endif
}
void w_handgrenade_updateammo(player pl)
{
Weapons_UpdateAmmo(pl, -1, pl.ammo_handgrenade, -1);
}
string w_handgrenade_wmodel(void)
{
return "models/w_grenade.mdl";
}
string w_handgrenade_pmodel(player pl)
{
return "models/p_grenade.mdl";
}
string w_handgrenade_deathmsg(void)
{
return "";

View File

@ -103,7 +103,6 @@ int
w_mp5_pickup(player pl, int new, int startammo)
{
#ifdef SERVER
if (new) {
#ifdef GEARBOX
pl.mp5_mag = 50;
@ -169,7 +168,8 @@ w_mp5_primary(player pl)
return;
/* Ammo check */
if ((pl.mp5_mag <= 0i) || (pl.WaterLevel() >= WATERLEVEL_SUBMERGED)) {
bool out_of_ammo = (pl.mp5_mag <= 0i) ? true : false;
if (out_of_ammo || (pl.WaterLevel() >= WATERLEVEL_SUBMERGED)) {
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.empty");
#endif
@ -227,7 +227,8 @@ w_mp5_secondary(player pl)
return;
/* Ammo check */
if ((pl.ammo_m203_grenade <= 0i) ? true : false || pl.WaterLevel() >= WATERLEVEL_SUBMERGED) {
bool out_of_ammo = (pl.ammo_m203_grenade <= 0i) ? true : false;
if (out_of_ammo || pl.WaterLevel() >= WATERLEVEL_SUBMERGED) {
#ifdef SERVER
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.empty");
#endif