From 32b5e29c5c40a098fd9fea2f64b1d116cfaa2b41 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Thu, 13 Oct 2022 21:46:33 +1000 Subject: [PATCH] func_door: merge door_use() and door_fire() Unnecessary tiny func is tiny and unnecessary (and suboptimal for perf). --- qcsrc/common/mapobjects/func/door.qc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index bae6a1965..40a6b1a1f 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -213,10 +213,13 @@ bool door_check_keys(entity door, entity player) return false; } -void door_fire(entity this, entity actor, entity trigger) +void door_use(entity this, entity actor, entity trigger) { - if (this.owner != this) - objerror (this, "door_fire: this.owner != this"); + //dprint("door_use (model: ");dprint(this.model);dprint(")\n"); + + if (!this.owner) + return; + this = this.owner; if (this.spawnflags & DOOR_TOGGLE) { @@ -257,14 +260,6 @@ void door_fire(entity this, entity actor, entity trigger) } while ((e != this) && (e != NULL)); } -void door_use(entity this, entity actor, entity trigger) -{ - //dprint("door_use (model: ");dprint(this.model);dprint(")\n"); - - if (this.owner) - door_fire(this.owner, actor, trigger); -} - void door_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { if(this.spawnflags & NOSPLASH) -- 2.39.2