From: terencehill Date: Mon, 11 May 2020 14:58:38 +0000 (+0200) Subject: Don't log frags and damage while round hasn't started yet (telefrags, lava, trigger_hurt) X-Git-Tag: xonotic-v0.8.5~1083 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b609dc6347c6214dfb20d6e86c16d0cad38c1ee3;p=xonotic%2Fxonotic-data.pk3dir.git Don't log frags and damage while round hasn't started yet (telefrags, lava, trigger_hurt) --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 9bf3f7c60..e5a8f47f9 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -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) diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index af2f4b574..0680d6a49 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -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;