From 26088ee249888c54f2b3257472811a354ce8fe29 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 13 Oct 2022 01:00:38 +1000 Subject: [PATCH] func_door: implement Q3 CRUSHER spawnflag --- qcsrc/common/mapobjects/func/door.qc | 4 +++- qcsrc/common/mapobjects/func/door.qh | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index a573faf6fb..bae6a19653 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 d760921c96..ce7025dd54 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 -- 2.39.2