]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
func_door: merge door_use() and door_fire()
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 13 Oct 2022 11:46:33 +0000 (21:46 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 16 Feb 2023 11:07:28 +0000 (21:07 +1000)
Unnecessary tiny func is tiny and unnecessary (and suboptimal for perf).

qcsrc/common/mapobjects/func/door.qc

index bae6a1965378b5d49bbd67631678ad9360353b0f..40a6b1a1f1d57db76077d017e061c0474e7e7fb7 100644 (file)
@@ -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)