]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/teleport.qc
Merge branch 'master' into TimePath/global_self
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / teleport.qc
index 5ff5fcf3357210703844b5c90690b56d07a392be..129f4e387cbab7ca43b3e9ec93e3fca1b0ff4973 100644 (file)
@@ -1,6 +1,6 @@
 #ifdef SVQC
 void trigger_teleport_use()
-{
+{SELFPARAM();
        if(teamplay)
                self.team = activator.team;
 #ifdef SVQC
@@ -9,8 +9,7 @@ void trigger_teleport_use()
 }
 
 void Teleport_Touch (void)
-{
-       entity oldself;
+{SELFPARAM();
        string s;
 
        if (self.active != ACTIVE_ACTIVE)
@@ -23,7 +22,7 @@ void Teleport_Touch (void)
        if(!other.vehicle.teleportable)
                return;
 
-       if(other.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
+       if(IS_TURRET(other))
                return;
 
        if(other.deadflag != DEAD_NO)
@@ -38,22 +37,18 @@ 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;
+       WITH(entity, self, e, SUB_UseTargets());
 }
 
 void spawnfunc_trigger_teleport()
-{
+{SELFPARAM();
        self.angles = '0 0 0';
 
        EXACTTRIGGER_INIT;