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://de.git.xonotic.org/?a=commitdiff_plain;h=2ea8f74a3acbdc19b1ca74b9abc010da0f3d5da9;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 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)