]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 eaa80d05f0a6ae2b9b6d5ebefb0c6041473b6488..0686c058257ee51e6c2252122e422330732e19a5 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 a7e7da546e0b05337766b8247b2832be94c7438c..5d9805e2ab93e46cbe68e7fd050bb1e7905e5950 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 1546d7da49ab6aab437ac464c95789048ddcf331..f38473b40b23a92a45d56fd454558a6e0467269d 100644 (file)
@@ -47,6 +47,8 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
 
        void entcs_force_origin(entity player);
 
+       bool radar_showenemies;
+
 #endif
 
 #ifdef CSQC
index cd73ea556787e79e4ab0d236a70c1b99ca32a54e..6ae5b2763e4f6d1651eb0c92bdfdb43b649c7b6c 100644 (file)
@@ -1,6 +1,7 @@
 #include "sv_nexball.qh"
 
 #include <server/gamelog.qh>
+#include <common/ent_cs.qh>
 
 .entity ballcarried;
 
index de3967c8a7731596218afb27b8d600d09fba6b87..8761e26f7c311cbc46393cb8ee87b4526c704c35 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 28af884dea59850713e39e202f6d149153f79c1d..9de337476bd5ff505d9cbe567a86b49e2eab7312 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 13867d1fbad9b62ae5eabb19e7d91a43dbd19e76..0e7cca67b284fb507659a8990f4f669c808f8f4f 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 cea9a4b91d5d2092213ce2684c70a15656ee07c7..da45243b63ae0b3f6b9738a71b418e40cbea92a4 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 62a15f680c1cb8117c68385a5f6e4119a50c16d3..354151c77f20baa5361f65eadf9083e4dabdad4a 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 fbab312487358712eca50ae3fd03dbdafa8443d8..1e91f635d34270bdadd69f8176107064922e0a86 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 95ef08482126f9da595e4a5c73a3087802b5f110..6983803dcebe3de3250244bc2f518bdbec414583 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 093e380764793ed423346ace256d5cf085d7a8bf..d9b3b0cd4ddc58db40ee6e2f8a807bceabb11cb2 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);