]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/teleport.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / teleport.qc
index 5adc1505c536d7995fbf0235031c5ae117515dcb..36c4cd22dda731c2e8562d023d05bbaeecc03599 100644 (file)
@@ -10,7 +10,6 @@ void trigger_teleport_use()
 
 void Teleport_Touch (void)
 {SELFPARAM();
-       entity oldself;
        string s;
 
        if (self.active != ACTIVE_ACTIVE)
@@ -38,18 +37,15 @@ void Teleport_Touch (void)
        if(IS_PLAYER(other))
                RemoveGrapplingHook(other);
 
-       entity e;
-       e = Simple_TeleportPlayer(self, other);
+       entity e = Simple_TeleportPlayer(self, other);
 
        activator = other;
        s = self.target; self.target = string_null;
        SUB_UseTargets();
        if (!self.target) self.target = s;
 
-       oldself = self;
-       self = e;
-       SUB_UseTargets();
-       self = oldself;
+       SELFCALL(e, SUB_UseTargets());
+       SELFCALL_DONE();
 }
 
 void spawnfunc_trigger_teleport()