]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a setup function for target_checkpoint entities, fixes #2515
authorMario <zacjardine@y7mail.com>
Tue, 1 Dec 2020 10:51:30 +0000 (20:51 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 1 Dec 2020 10:51:30 +0000 (20:51 +1000)
qcsrc/server/race.qc

index f66ca7c8df8e7280ccd7c47955f48fa8649fd6cd..70a98083efb22a03171f78a0adae0fe623c189ac 100644 (file)
@@ -1041,7 +1041,7 @@ spawnfunc(trigger_race_checkpoint)
        InitializeEntity(this, trigger_race_checkpoint_verify, INITPRIO_FINDTARGET);
 }
 
-spawnfunc(target_checkpoint) // defrag entity
+void target_checkpoint_setup(entity this)
 {
        if(!g_race && !g_cts) { delete(this); return; }
        defrag_ents = 1;
@@ -1086,8 +1086,15 @@ spawnfunc(target_checkpoint) // defrag entity
        InitializeEntity(this, trigger_race_checkpoint_verify, INITPRIO_FINDTARGET);
 }
 
-spawnfunc(target_startTimer) { spawnfunc_target_checkpoint(this); }
-spawnfunc(target_stopTimer) { spawnfunc_target_checkpoint(this); }
+spawnfunc(target_checkpoint)
+{
+       // xonotic defrag entity
+       target_checkpoint_setup(this);
+}
+
+// compatibility entity names
+spawnfunc(target_startTimer) { target_checkpoint_setup(this); }
+spawnfunc(target_stopTimer) { target_checkpoint_setup(this); }
 
 void race_AbandonRaceCheck(entity p)
 {