]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
Revert "Record player race move time in PlayerPreThink so it can be recorded while...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / cts / sv_cts.qc
index 636aeb6de7550f64735679ad00327eea5d400857..144788917415c2557d8fd5f5da7a81e3d803fb7b 100644 (file)
@@ -1,10 +1,17 @@
 #include "sv_cts.qh"
 
+#include <server/client.qh>
 #include <server/race.qh>
-#include <server/items.qh>
+#include <server/world.qh>
+#include <server/gamelog.qh>
+#include <server/intermission.qh>
+#include <server/items/spawning.qh>
+#include <server/weapons/common.qh>
+#include <common/mapobjects/triggers.qh>
 
 float autocvar_g_cts_finish_kill_delay;
 bool autocvar_g_cts_selfdamage;
+bool autocvar_g_cts_removeprojectiles;
 
 // legacy bot roles
 .float race_checkpoint;
@@ -142,7 +149,7 @@ MUTATOR_HOOKFUNCTION(cts, reset_map_global)
        Score_NicePrint(NULL);
 
        race_ClearRecords();
-       PlayerScore_Sort(race_place, 0, 1, 0);
+       PlayerScore_Sort(race_place, 0, true, false);
 
        FOREACH_CLIENT(true, {
                if(it.race_place)
@@ -207,7 +214,7 @@ MUTATOR_HOOKFUNCTION(cts, MakePlayerObserver)
        entity player = M_ARGV(0, entity);
 
        if(GameRules_scoring_add(player, RACE_FASTEST, 0))
-               player.frags = FRAGS_LMS_LOSER;
+               player.frags = FRAGS_PLAYER_OUT_OF_GAME;
        else
                player.frags = FRAGS_SPECTATOR;
 
@@ -253,6 +260,14 @@ MUTATOR_HOOKFUNCTION(cts, PlayerDies)
 
        frag_target.respawn_flags |= RESPAWN_FORCE;
        race_AbandonRaceCheck(frag_target);
+
+       if(autocvar_g_cts_removeprojectiles)
+       {
+               IL_EACH(g_projectiles, it.owner == frag_target && (it.flags & FL_PROJECTILE),
+               {
+                       delete(it);
+               });
+       }
 }
 
 MUTATOR_HOOKFUNCTION(cts, HavocBot_ChooseRole)
@@ -267,7 +282,7 @@ MUTATOR_HOOKFUNCTION(cts, GetPressedKeys)
 {
        entity player = M_ARGV(0, entity);
 
-       if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1)
+       if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
        {
                if (!player.stored_netname)
                        player.stored_netname = strzone(uid2name(player.crypto_idfp));