]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
func_door: implement Q3 CRUSHER spawnflag
authorbones_was_here <bones_was_here@xonotic.au>
Fri, 15 Sep 2023 06:47:11 +0000 (16:47 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 15 Sep 2023 07:11:44 +0000 (17:11 +1000)
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/func/door.qh

index 1853510d565ddccfe41047d17598674a581953be..c45298dfa84e8da3227767628cba0fadc02600a1 100644 (file)
@@ -29,6 +29,7 @@ void door_blocked(entity this, entity blocker)
 {
        bool reverse = false;
        if((this.spawnflags & DOOR_CRUSH)
+               && !Q3COMPAT_COMMON
 #ifdef SVQC
                && (blocker.takedamage != DAMAGE_NO)
 #elif defined(CSQC)
@@ -53,6 +54,7 @@ void door_blocked(entity this, entity blocker)
                        && blocker.takedamage != DAMAGE_NO
 #endif
                        && this.wait >= 0
+                       && !(Q3COMPAT_COMMON && (this.spawnflags & Q3_DOOR_CRUSHER))
                )
                {
                        if (this.state == STATE_DOWN)
@@ -75,7 +77,7 @@ void door_blocked(entity this, entity blocker)
                else
                {
                        //gib dying stuff just to make sure
-                       if((this.dmg) && (blocker.takedamage != DAMAGE_NO))    // Shall we bite?
+                       if (this.dmg && blocker.takedamage != DAMAGE_NO && IS_DEAD(blocker))    // Shall we bite?
                                Damage (blocker, this, this, 10000, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, blocker.origin, '0 0 0');
                }
 #endif
index d760921c96257508e4a82e03cb77c7bac7169f12..ce7025dd5488854e741bb166c9c3e2db8b1a8f2a 100644 (file)
@@ -13,6 +13,7 @@ const int DOOR_TOGGLE = BIT(5);
 const int DOOR_NONSOLID = BIT(10);
 const int DOOR_CRUSH = BIT(11); // can't use CRUSH cause that is the same as DOOR_DONT_LINK
 
+#define Q3_DOOR_CRUSHER BIT(2) // in Q3 this disables the auto reverse so the blocking player takes damage every frame
 
 #ifdef CSQC
 // stuff for preload