From 2ea8f74a3acbdc19b1ca74b9abc010da0f3d5da9 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 c45298dfa..418bdda9a 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