]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't log frags and damage while round hasn't started yet (telefrags, lava, trigger_hurt)
authorterencehill <piuntn@gmail.com>
Mon, 11 May 2020 14:58:38 +0000 (16:58 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 11 May 2020 14:58:38 +0000 (16:58 +0200)
qcsrc/server/player.qc
qcsrc/server/scores.qc

index 9bf3f7c60283db691cbfa8430aeba0ad4a504aec..e5a8f47f90f859908e0ba951776cbd71a3bbf854 100644 (file)
@@ -468,6 +468,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
 
                        float realdmg = damage - excess;
                        if (this != attacker && realdmg)
+                       if (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime)
                        {
                                if (IS_PLAYER(attacker) && DIFF_TEAM(attacker, this)) {
                                        GameRules_scoring_add(attacker, DMG, realdmg);
@@ -490,6 +491,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        bool valid_damage_for_weaponstats = false;
        Weapon awep = WEP_Null;
 
+       if (!(round_handler_IsActive() && !round_handler_IsRoundStarted()) && time >= game_starttime)
        if(vbot || IS_REAL_CLIENT(this))
        if(abot || IS_REAL_CLIENT(attacker))
        if(attacker && this != attacker)
index af2f4b574f43a57f0c098d19c47b5fe2754428ac..0680d6a491730df2bfedbc252f870bd5c651ee02 100644 (file)
@@ -107,8 +107,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 +337,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;