]> 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>
Wed, 12 Oct 2022 15:00:38 +0000 (01:00 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 16 Feb 2023 11:07:27 +0000 (21:07 +1000)
qcsrc/common/mapobjects/func/door.qc
qcsrc/common/mapobjects/func/door.qh

index a573faf6fb11a2ff636563665d85cebf9c1b8872..bae6a1965378b5d49bbd67631678ad9360353b0f 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