From d3a9cdaccecdd3fcebc1b317be5b29c461c55b15 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 17 Apr 2022 19:53:31 +1000 Subject: [PATCH] q3compat: allow damage to open a func_door with no health and no targetname Fixes doors that should open when shot on some Q3* maps Also fixed some indenting and a comment --- qcsrc/common/mapobjects/func/door.qc | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index d3c042ef9..6b69077a0 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -655,7 +655,7 @@ void door_init_shared(entity this) // TODO: other soundpacks if (this.sounds > 0 || q3compat) { - // Doors in Q3 always have sounds (they're hard coded in Q3 engine) + // Doors in Q3 always have sounds (they're hard coded) this.noise2 = "plats/medplat1.wav"; this.noise1 = "plats/medplat2.wav"; } @@ -683,14 +683,14 @@ void door_init_shared(entity this) precache_sound(this.noise2); } - if(autocvar_sv_doors_always_open) - { - this.wait = -1; - } - else if (!this.wait) - { - this.wait = 3; - } + if(autocvar_sv_doors_always_open) + { + this.wait = -1; + } + else if (!this.wait) + { + this.wait = 3; + } if (!this.lip) { @@ -699,7 +699,7 @@ void door_init_shared(entity this) this.state = STATE_BOTTOM; - if (GetResource(this, RES_HEALTH)) + if (GetResource(this, RES_HEALTH) || (q3compat && this.targetname == "")) { //this.canteamdamage = true; // TODO this.takedamage = DAMAGE_YES; @@ -744,17 +744,17 @@ spawnfunc(func_door) this.pos1 = this.origin; this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip); - if(autocvar_sv_doors_always_open) - { - this.speed = max(750, this.speed); - } - else if (!this.speed) - { + if(autocvar_sv_doors_always_open) + { + this.speed = max(750, this.speed); + } + else if (!this.speed) + { if (q3compat) this.speed = 400; else - this.speed = 100; - } + this.speed = 100; + } settouch(this, door_touch); -- 2.39.2