From: bones_was_here Date: Fri, 15 Sep 2023 06:47:11 +0000 (+1000) Subject: func_door: implement Q3 CRUSHER spawnflag X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8de4f86b997b16412ad3019cbc207426be171b5;p=xonotic%2Fxonotic-data.pk3dir.git func_door: implement Q3 CRUSHER spawnflag --- diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 1853510d5..c45298dfa 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -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 diff --git a/qcsrc/common/mapobjects/func/door.qh b/qcsrc/common/mapobjects/func/door.qh index d760921c9..ce7025dd5 100644 --- a/qcsrc/common/mapobjects/func/door.qh +++ b/qcsrc/common/mapobjects/func/door.qh @@ -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