]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use intrusive lists in a sneaky way to avoid a findchain in spawn point filtering
authorMario <mario@smbclan.net>
Wed, 20 Jun 2018 08:21:08 +0000 (18:21 +1000)
committerMario <mario@smbclan.net>
Wed, 20 Jun 2018 08:21:08 +0000 (18:21 +1000)
qcsrc/server/spawnpoints.qc

index a57c9e4350d587afd19e232848d167f6b68b8840..e0e33e4803c87445641359a8c76824cc821a19a8 100644 (file)
@@ -372,7 +372,16 @@ entity SelectSpawnPoint(entity this, bool anypoint)
 
 
        // get the entire list of spots
-       entity firstspot = findchain(classname, "info_player_deathmatch");
+       //entity firstspot = findchain(classname, "info_player_deathmatch");
+       entity firstspot = IL_FIRST(g_spawnpoints);
+       entity prev = NULL;
+       IL_EACH(g_spawnpoints, true,
+       {
+               if(prev)
+                       prev.chain = it;
+               it.chain = NULL;
+               prev = it;
+       });
        // filter out the bad ones
        // (note this returns the original list if none survived)
        if(anypoint)