]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename PHYS_DEAD to IS_DEAD and make it usable outside of player physics
authorMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:35:48 +0000 (05:35 +1000)
committerMario <mario@smbclan.net>
Thu, 31 Dec 2015 19:35:48 +0000 (05:35 +1000)
qcsrc/client/miscfunctions.qh
qcsrc/common/mutators/mutator/dodging/dodging.qc
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/swamp.qc
qcsrc/common/triggers/trigger/teleport.qc
qcsrc/server/miscfunctions.qh

index 3066fc6c642c8f7c5530732352911222e61bc18b..a2fa4edced358d7d6812ce5b5b7c38e7b4177eb2 100644 (file)
@@ -35,6 +35,9 @@ float PreviewExists(string name);
 vector rotate(vector v, float a);
 
 
+#define IS_DEAD(s) (((s).classname == "csqcmodel") ? (s).csqcmodel_isdead : ((s).health <= 0))
+
+
 // decolorizes and team colors the player name when needed
 string playername(string thename, float teamid);
 
index 7be7d6939dc48d0d2fa873707a49f2b31190e16f..915dbe66346435b23da735cf90318b952412b667 100644 (file)
@@ -176,7 +176,7 @@ void PM_dodging(entity this)
        if (!PHYS_DODGING)
                return;
 
-    if (PHYS_DEAD(this))
+    if (IS_DEAD(this))
         return;
 
        // when swimming, no dodging allowed..
index bd79aa6483d922abea1ee8f5b06dff2747325218..4465e5da6b666fe05c9b20c872c871ae00d2108f 100644 (file)
@@ -1446,7 +1446,7 @@ void PM_Main(entity this)
        }
 #endif
 
-       if(PHYS_DEAD(this))
+       if(IS_DEAD(this))
        {
                // handle water here
                vector midpoint = ((this.absmin + this.absmax) * 0.5);
index 978649026260460935d38dae8388fb42791c6ed4..ea318c5b013f540801aa5fa2d196c5e5a8e9ea0a 100644 (file)
@@ -199,8 +199,6 @@ bool IsFlying(entity a);
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       boolean(input_buttons & BIT(17))
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       boolean(input_buttons & BIT(18))
 
-       #define PHYS_DEAD(s)                        ((s).csqcmodel_isdead)
-
        #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE  (boolean(moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE))
        #define GAMEPLAYFIX_NOGRAVITYONGROUND           (boolean(moveflags & MOVEFLAG_NOGRAVITYONGROUND))
        #define GAMEPLAYFIX_Q2AIRACCELERATE             (boolean(moveflags & MOVEFLAG_Q2AIRACCELERATE))
@@ -261,8 +259,6 @@ bool IsFlying(entity a);
        #define PHYS_INPUT_BUTTON_BUTTON15(s)       ((s).button15)
        #define PHYS_INPUT_BUTTON_BUTTON16(s)       ((s).button16)
 
-       #define PHYS_DEAD(s)                        ((s).deadflag != DEAD_NO)
-
        #define GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE  autocvar_sv_gameplayfix_gravityunaffectedbyticrate
        #define GAMEPLAYFIX_NOGRAVITYONGROUND           autocvar_sv_gameplayfix_nogravityonground
        #define GAMEPLAYFIX_Q2AIRACCELERATE             autocvar_sv_gameplayfix_q2airaccelerate
index 35a2ff8f71529991254240a5f695757a3a21f4df..99ee91f827c0673f4496244eab15704853ab897d 100644 (file)
@@ -31,7 +31,7 @@ void door_blocked()
 #ifdef SVQC
                && (other.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
-               && !PHYS_DEAD(other)
+               && !IS_DEAD(other)
 #endif
        )
        { // KIll Kill Kill!!
@@ -47,7 +47,7 @@ void door_blocked()
 #endif
 
                 // don't change direction for dead or dying stuff
-               if(PHYS_DEAD(other)
+               if(IS_DEAD(other)
 #ifdef SVQC
                        && (other.takedamage == DAMAGE_NO)
 #endif
@@ -339,7 +339,7 @@ void door_generic_plat_blocked()
 #endif
 
                 //Dont chamge direction for dead or dying stuff
-               if(PHYS_DEAD(other) && (other.takedamage == DAMAGE_NO))
+               if(IS_DEAD(other) && (other.takedamage == DAMAGE_NO))
                {
                        if (self.wait >= 0)
                        {
@@ -432,9 +432,9 @@ void door_trigger_touch()
 {SELFPARAM();
        if (other.health < 1)
 #ifdef SVQC
-               if (!((other.iscreature || (other.flags & FL_PROJECTILE)) && !PHYS_DEAD(other)))
+               if (!((other.iscreature || (other.flags & FL_PROJECTILE)) && !IS_DEAD(other)))
 #elif defined(CSQC)
-               if(!((IS_CLIENT(other) || other.classname == "csqcprojectile") && !PHYS_DEAD(other)))
+               if(!((IS_CLIENT(other) || other.classname == "csqcprojectile") && !IS_DEAD(other)))
 #endif
                        return;
 
index 11f0bd0024a25b407cb320659cea75114d937916..5eb47fa36afcd075379a91e4ba408c6abe8044c7 100644 (file)
@@ -103,7 +103,7 @@ void plat_center_touch()
 #elif defined(CSQC)
        if (!IS_PLAYER(other))
                return;
-       if(PHYS_DEAD(other))
+       if(IS_DEAD(other))
                return;
 #endif
 
index 37ab1f694e97ba314a52906872686a3cd022a557..1050f8ebdbcf905bd372968f204ed0c811030732 100644 (file)
@@ -22,7 +22,7 @@
 
 float check_tdeath(entity player, vector org, vector telefragmin, vector telefragmax)
 {
-       if (IS_PLAYER(player) && !PHYS_DEAD(player))
+       if (IS_PLAYER(player) && !IS_DEAD(player))
        {
                TDEATHLOOP(org)
                {
@@ -30,7 +30,7 @@ float check_tdeath(entity player, vector org, vector telefragmin, vector telefra
                        if (!(teamplay && autocvar_g_telefrags_teamplay && head.team == player.team))
                #endif
                                if(IS_PLAYER(head))
-                                       if(!PHYS_DEAD(head))
+                                       if(!IS_DEAD(head))
                                                return 1;
                }
        }
index 89aa02fe46cab5d4dadb9225019a9af75168b405..ad9c872dae6a4e17f3d233390186045539d16850 100644 (file)
@@ -64,7 +64,7 @@ void swamp_touch()
 {SELFPARAM();
        // If whatever thats touching the swamp is not a player
        // or if its a dead player, just dont care abt it.
-       if(!IS_PLAYER(other) || PHYS_DEAD(other))
+       if(!IS_PLAYER(other) || IS_DEAD(other))
                return;
 
        EXACTTRIGGER_TOUCH;
index 5735f0bb5ee4ea0132691d93176dee69a68035bd..c013eb867fa446e1175f383dd50dc2f159e75f86 100644 (file)
@@ -31,7 +31,7 @@ void Teleport_Touch ()
                return;
 #endif
 
-       if(PHYS_DEAD(other))
+       if(IS_DEAD(other))
                return;
 
        if(self.team)
index 9df9042aaf129c00c2a08325b4781ee37d09706c..4cb4e20b33b1537d041a6c3db75bd937c2bc5c7a 100644 (file)
@@ -117,6 +117,8 @@ void WarpZone_crosshair_trace(entity pl);
 
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag);
 
+#define IS_DEAD(s) ((s).deadflag != DEAD_NO)
+
 
 #define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
 #define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))