From: bones_was_here Date: Thu, 13 Oct 2022 11:46:33 +0000 (+1000) Subject: func_door: merge door_use() and door_fire() X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=32b5e29c5c40a098fd9fea2f64b1d116cfaa2b41;p=xonotic%2Fxonotic-data.pk3dir.git func_door: merge door_use() and door_fire() Unnecessary tiny func is tiny and unnecessary (and suboptimal for perf). --- 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)