X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=83c5d5ee5339e96aaef7405e4206837655767d6f;hb=8141387a9bf057652453a8d4dc530116cf4cc31a;hp=5e1c8d9db567b67fd8f3635803cd6dd4266fbd25;hpb=c624e64397b1ac7cbe3b2128a732d2f762443db3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 5e1c8d9db..83c5d5ee5 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -292,8 +292,8 @@ float PlayerScore_Clear(entity player) sk = CS(player).scorekeeper; FOREACH(Scores, true, { if(sk.(scores(it)) != 0) - if(scores_label(it) != "") - sk.SendFlags |= BIT(i % 16); + //if(scores_label(it) != "") + sk.SendFlags |= (2 ** (i % 16)); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -310,8 +310,8 @@ void Score_ClearAll() if (!sk) continue; FOREACH(Scores, true, { if(sk.(scores(it)) != 0) - if(scores_label(it) != "") - sk.SendFlags |= BIT(i % 16); + //if(scores_label(it) != "") + sk.SendFlags |= (2 ** (i % 16)); if(i != SP_ELO.m_id) sk.(scores(it)) = 0; }); @@ -324,8 +324,8 @@ void Score_ClearAll() for(int j = 0; j < MAX_TEAMSCORE; ++j) { if(sk.(teamscores(j)) != 0) - if(teamscores_label(j) != "") - sk.SendFlags |= BIT(j); + //if(teamscores_label(j) != "") + sk.SendFlags |= (2 ** j); sk.(teamscores(j)) = 0; } } @@ -372,8 +372,8 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) { return s.(scores(scorefield)); } - if(scores_label(scorefield) != "") - s.SendFlags |= BIT(scorefield.m_id % 16); + //if(scores_label(scorefield) != "") + s.SendFlags |= (2 ** (scorefield.m_id % 16)); if(!warmup_stage) PlayerStats_GameReport_Event_Player(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score); s.(scores(scorefield)) += score; @@ -441,6 +441,24 @@ float PlayerScore_Compare(entity t1, entity t2, bool strict) return result; } +bool Score_NewLeader() +{ + if(teamplay) { + if (WinningConditionHelper_winnerteam != WinningConditionHelper_winnerteam_last && (WinningConditionHelper_secondteam || WinningConditionHelper_equality)) + { + WinningConditionHelper_winnerteam_last = WinningConditionHelper_winnerteam; + return true; + } + } else { + if (WinningConditionHelper_winner != WinningConditionHelper_winner_last && (WinningConditionHelper_second || WinningConditionHelper_equality)) + { + WinningConditionHelper_winner_last = WinningConditionHelper_winner; + return true; + } + } + return false; +} + void WinningConditionHelper(entity this) { float c; @@ -543,7 +561,15 @@ void WinningConditionHelper(entity this) WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, false) == 0); if(WinningConditionHelper_equality) + { + WinningConditionHelper_equality_one = WinningConditionHelper_winner; + WinningConditionHelper_equality_two = WinningConditionHelper_second; WinningConditionHelper_winner = WinningConditionHelper_second = NULL; + } + else + { + WinningConditionHelper_equality_one = WinningConditionHelper_equality_two = NULL; + } WinningConditionHelper_topscore = winnerscorekeeper.scores_primary; WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;