From aae27b54eb620186060de31b49b6f1d7cabf3358 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 2 Aug 2020 16:44:48 +1000 Subject: [PATCH] Move generic entity flags to a common constants location so they are included in a single list, fixes a few overlapped flags causing issues in gameplay --- qcsrc/client/weapons/projectile.qh | 2 -- qcsrc/common/constants.qh | 25 +++++++++++++++++++ qcsrc/common/ent_cs.qh | 2 ++ .../gamemodes/gamemode/nexball/sv_nexball.qc | 1 + .../common/gamemodes/gamemode/race/sv_race.qc | 1 + qcsrc/common/physics/movetypes/movetypes.qc | 2 +- qcsrc/common/physics/movetypes/movetypes.qh | 4 --- qcsrc/common/physics/player.qh | 5 ---- qcsrc/server/constants.qh | 8 ------ qcsrc/server/defs.qh | 6 ----- qcsrc/server/miscfunctions.qc | 1 + qcsrc/server/weapons/common.qh | 4 +++ 12 files changed, 35 insertions(+), 26 deletions(-) diff --git a/qcsrc/client/weapons/projectile.qh b/qcsrc/client/weapons/projectile.qh index eaa80d05f0..0686c05825 100644 --- a/qcsrc/client/weapons/projectile.qh +++ b/qcsrc/client/weapons/projectile.qh @@ -29,5 +29,3 @@ void Projectile_Draw(entity this); void loopsound(entity e, int ch, Sound samp, float vol, float attn); void Ent_RemoveProjectile(entity this); - -const int FL_PROJECTILE = BIT(15); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index a7e7da546e..5d9805e2ab 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -57,3 +57,28 @@ const vector PL_CROUCH_MIN_CONST = '-16 -16 -24'; const int GTV_FORBIDDEN = 0; // Cannot be voted const int GTV_AVAILABLE = 1; // Can be voted const int GTV_CUSTOM = 2; // Custom entry + +// generic entity flags +// engine flags can't be redefined as they are used by the engine (unfortunately), they are listed here for posterity +#ifdef CSQC +const int FL_FLY = 1; /* BIT(0) */ +const int FL_SWIM = 2; /* BIT(1) */ +const int FL_CLIENT = 8; /* BIT(2) */ // set for all client edicts +const int FL_INWATER = 16; /* BIT(3) */ // for enter / leave water splash +const int FL_MONSTER = 32; /* BIT(4) */ +const int FL_GODMODE = 64; /* BIT(5) */ // player cheat +const int FL_NOTARGET = 128; /* BIT(6) */ // player cheat +const int FL_ITEM = 256; /* BIT(7) */ // extra wide size for bonus items +const int FL_ONGROUND = 512; /* BIT(8) */ // standing on something +const int FL_PARTIALGROUND = 1024; /* BIT(9) */ // not all corners are valid +const int FL_WATERJUMP = 2048; /* BIT(10) */ // player jumping out of water +const int FL_JUMPRELEASED = 4096; /* BIT(11) */ // for jump debouncing +#endif +const int FL_WEAPON = BIT(12); +const int FL_POWERUP = BIT(13); +const int FL_PROJECTILE = BIT(14); +const int FL_TOSSED = BIT(15); +const int FL_SPAWNING = BIT(16); +const int FL_PICKUPITEMS = BIT(17); +const int FL_DUCKED = BIT(18); +const int FL_ONSLICK = BIT(19); diff --git a/qcsrc/common/ent_cs.qh b/qcsrc/common/ent_cs.qh index 1546d7da49..f38473b40b 100644 --- a/qcsrc/common/ent_cs.qh +++ b/qcsrc/common/ent_cs.qh @@ -47,6 +47,8 @@ REGISTER_NET_TEMP(CLIENT_ENTCS) void entcs_force_origin(entity player); + bool radar_showenemies; + #endif #ifdef CSQC diff --git a/qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc index cd73ea5567..6ae5b2763e 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc @@ -1,6 +1,7 @@ #include "sv_nexball.qh" #include +#include .entity ballcarried; diff --git a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc index de3967c8a7..8761e26f7c 100644 --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -3,6 +3,7 @@ #include #include #include +#include #define autocvar_g_race_laps_limit cvar("g_race_laps_limit") float autocvar_g_race_qualifying_timelimit; diff --git a/qcsrc/common/physics/movetypes/movetypes.qc b/qcsrc/common/physics/movetypes/movetypes.qc index 28af884dea..9de337476b 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qc +++ b/qcsrc/common/physics/movetypes/movetypes.qc @@ -504,7 +504,7 @@ int _Movetype_ContentsMask(entity this) // SV_GenericHitSuperContentsMask return this.dphitcontentsmask; else if(this.solid == SOLID_SLIDEBOX) { - if(this.flags & 32) // TODO: FL_MONSTER + if(this.flags & FL_MONSTER) return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_MONSTERCLIP; else return DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; diff --git a/qcsrc/common/physics/movetypes/movetypes.qh b/qcsrc/common/physics/movetypes/movetypes.qh index 13867d1fba..0e7cca67b2 100644 --- a/qcsrc/common/physics/movetypes/movetypes.qh +++ b/qcsrc/common/physics/movetypes/movetypes.qh @@ -135,8 +135,6 @@ const int MOVETYPE_FOLLOW = 12; const int MOVETYPE_PHYSICS = 32; const int MOVETYPE_FLY_WORLDONLY = 33; -const int FL_ITEM = 256; -const int FL_ONGROUND = 512; #elif defined(SVQC) const int MOVETYPE_ANGLENOCLIP = 1; const int MOVETYPE_ANGLECLIP = 2; @@ -145,8 +143,6 @@ const int MOVETYPE_ANGLECLIP = 2; const int MOVETYPE_QCPLAYER = 150; // QC-driven player physics, no think functions! const int MOVETYPE_QCENTITY = 151; // QC-driven entity physics, some think functions! -const int FL_ONSLICK = BIT(20); - const int MOVETYPE_FAKEPUSH = 13; const int MOVEFLAG_VALID = BIT(23); diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index cea9a4b91d..da45243b63 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -7,8 +7,6 @@ #include #endif -const int FL_DUCKED = BIT(19); - .entity conveyor; .float race_penalty; @@ -172,9 +170,6 @@ STATIC_INIT(PHYS_INPUT_BUTTON) string autocvar_cl_jumpspeedcap_min; string autocvar_cl_jumpspeedcap_max; - const int FL_WATERJUMP = 2048; // player jumping out of water - const int FL_JUMPRELEASED = 4096; // for jump debouncing - .float watertype; .float waterlevel; .int items; diff --git a/qcsrc/server/constants.qh b/qcsrc/server/constants.qh index 62a15f680c..354151c77f 100644 --- a/qcsrc/server/constants.qh +++ b/qcsrc/server/constants.qh @@ -1,13 +1,5 @@ #pragma once -const int FL_WEAPON = BIT(13); -const int FL_POWERUP = BIT(14); -const int FL_PROJECTILE = BIT(15); -const int FL_TOSSED = BIT(16); -const int FL_NO_WEAPON_STAY = BIT(17); -const int FL_SPAWNING = BIT(18); -const int FL_PICKUPITEMS = BIT(19); - const int SVC_SETVIEW = 5; const int RESPAWN_FORCE = BIT(0); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index fbab312487..1e91f635d3 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -124,8 +124,6 @@ float g_nexball_meter_period; string matchid; -bool radar_showenemies; - .int minelayer_mines; .float vortex_charge; .float vortex_charge_rottime; @@ -137,10 +135,6 @@ bool radar_showenemies; .int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab -#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE -// when doing this, hagar can go through clones -// #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX - .int spectatee_status; .bool zoomstate; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 95ef084821..6983803dce 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -16,6 +16,7 @@ #include #include "player.qh" #include "weapons/accuracy.qh" +#include "weapons/common.qh" #include "weapons/csqcprojectile.qh" #include "weapons/selection.qh" #include "../common/command/_mod.qh" diff --git a/qcsrc/server/weapons/common.qh b/qcsrc/server/weapons/common.qh index 093e380764..d9b3b0cd4d 100644 --- a/qcsrc/server/weapons/common.qh +++ b/qcsrc/server/weapons/common.qh @@ -10,6 +10,10 @@ void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) .float misc_bulletcounter; +#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE +// when doing this, hagar can go through clones +// #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX + .int missile_flags; const int MIF_SPLASH = BIT(1); const int MIF_ARC = BIT(2); -- 2.39.2