Move generic entity flags to a common constants location so they are included in...
authorMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 06:44:48 +0000 (16:44 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 06:44:48 +0000 (16:44 +1000)
12 files changed:
qcsrc/client/weapons/projectile.qh
qcsrc/common/constants.qh
qcsrc/common/ent_cs.qh
qcsrc/common/gamemodes/gamemode/nexball/sv_nexball.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/movetypes.qh
qcsrc/common/physics/player.qh
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/common.qh

index eaa80d0..0686c05 100644 (file)
@@ -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);
index a7e7da5..5d9805e 100644 (file)
@@ -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);
index 1546d7d..f38473b 100644 (file)
@@ -47,6 +47,8 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
 
        void entcs_force_origin(entity player);
 
+       bool radar_showenemies;
+
 #endif
 
 #ifdef CSQC
index cd73ea5..6ae5b27 100644 (file)
@@ -1,6 +1,7 @@
 #include "sv_nexball.qh"
 
 #include <server/gamelog.qh>
+#include <common/ent_cs.qh>
 
 .entity ballcarried;
 
index de3967c..8761e26 100644 (file)
@@ -3,6 +3,7 @@
 #include <server/g_world.qh>
 #include <server/gamelog.qh>
 #include <server/race.qh>
+#include <common/ent_cs.qh>
 
 #define autocvar_g_race_laps_limit cvar("g_race_laps_limit")
 float autocvar_g_race_qualifying_timelimit;
index 28af884..9de3374 100644 (file)
@@ -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;
index 13867d1..0e7cca6 100644 (file)
@@ -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);
index cea9a4b..da45243 100644 (file)
@@ -7,8 +7,6 @@
        #include <common/state.qh>
 #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;
index 62a15f6..354151c 100644 (file)
@@ -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);
index fbab312..1e91f63 100644 (file)
@@ -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;
 
index 95ef084..6983803 100644 (file)
@@ -16,6 +16,7 @@
 #include <server/items/spawning.qh>
 #include "player.qh"
 #include "weapons/accuracy.qh"
+#include "weapons/common.qh"
 #include "weapons/csqcprojectile.qh"
 #include "weapons/selection.qh"
 #include "../common/command/_mod.qh"
index 093e380..d9b3b0c 100644 (file)
@@ -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);