]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Merge branch 'terencehill/texture_names_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index af2f4b574f43a57f0c098d19c47b5fe2754428ac..69b18ba2a206d8685dd1ef33bf18604007a971fb 100644 (file)
@@ -5,6 +5,7 @@
 #include <server/g_world.qh>
 #include <server/miscfunctions.qh>
 #include <server/mutators/_mod.qh>
+#include <server/round_handler.qh>
 #include <common/net_linked.qh>
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
@@ -107,8 +108,11 @@ float TeamScore_AddToTeam(int t, float scorefield, float score)
 {
        entity s;
 
-       if(game_stopped)
+       if(game_stopped || time < game_starttime
+               || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
+       {
                score = 0;
+       }
 
        if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
        if(t <= 0 || t >= 16)
@@ -334,9 +338,11 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
        score = M_ARGV(1, float);
 
-       if(game_stopped)
-       if(!mutator_returnvalue)
+       if((!mutator_returnvalue && game_stopped) || time < game_starttime
+               || (round_handler_IsActive() && !round_handler_IsRoundStarted()))
+       {
                score = 0;
+       }
 
        if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
        entity s = CS(player).scorekeeper;