]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/race.qc
Merge branch 'master' into Mario/use1
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / race.qc
index 9fd6ca7b3f9d2f0db732ebcd6a673d7c9b0ea30a..5a023a1dcc8224cecfdc6a4368bbd27761779c70 100644 (file)
@@ -580,10 +580,9 @@ void checkpoint_passed()
         */
        if (!((self.spawnflags & 2) && (IS_PLAYER(other))))
        {
-               activator = other;
                oldmsg = self.message;
                self.message = "";
-               SUB_UseTargets();
+               SUB_UseTargets(self, other, other); // TODO: should we be using other for the trigger here?
                self.message = oldmsg;
        }
 
@@ -652,10 +651,9 @@ void checkpoint_passed()
                 */
                if(self.spawnflags & 2)
                {
-                       activator = other;
                        oldmsg = self.message;
                        self.message = "";
-                       SUB_UseTargets();
+                       SUB_UseTargets(self, other, other); // TODO: should we be using other for the trigger here?
                        self.message = oldmsg;
                }
 
@@ -707,12 +705,12 @@ void checkpoint_touch()
        checkpoint_passed();
 }
 
-void checkpoint_use()
+void checkpoint_use(entity this, entity actor, entity trigger)
 {
-       if(other.classname == "info_player_deathmatch") // a spawn, a spawn
+       if(trigger.classname == "info_player_deathmatch") // a spawn, a spawn
                return;
 
-       other = activator;
+       other = actor;
        checkpoint_passed();
 }
 
@@ -914,7 +912,7 @@ spawnfunc(trigger_race_checkpoint)
 
        EXACTTRIGGER_INIT;
 
-       self.use = checkpoint_use;
+       self.use1 = checkpoint_use;
        if (!(self.spawnflags & 1))
                self.touch = checkpoint_touch;
 
@@ -963,7 +961,7 @@ spawnfunc(target_checkpoint) // defrag entity
 
        EXACTTRIGGER_INIT;
 
-       self.use = checkpoint_use;
+       self.use1 = checkpoint_use;
        if (!(self.spawnflags & 1))
                self.touch = checkpoint_touch;
 
@@ -1107,9 +1105,9 @@ void penalty_touch()
        }
 }
 
-void penalty_use()
-{SELFPARAM();
-       race_ImposePenaltyTime(activator, self.race_penalty, self.race_penalty_reason);
+void penalty_use(entity this, entity actor, entity trigger)
+{
+       race_ImposePenaltyTime(actor, this.race_penalty, this.race_penalty_reason);
 }
 
 spawnfunc(trigger_race_penalty)
@@ -1119,7 +1117,7 @@ spawnfunc(trigger_race_penalty)
 
        EXACTTRIGGER_INIT;
 
-       self.use = penalty_use;
+       self.use1 = penalty_use;
        if (!(self.spawnflags & 1))
                self.touch = penalty_touch;