X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=83c5d5ee5339e96aaef7405e4206837655767d6f;hb=8141387a9bf057652453a8d4dc530116cf4cc31a;hp=2cedc4aded31c9abce24c8fa5bafdcbe92987bac;hpb=145c3c5bd65333eb4740ff49abb18183e86b1855;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 2cedc4ade..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; @@ -864,7 +890,7 @@ void Score_NicePrint_Team(entity to, float t, float w) { fl = teamscores_flags(i); sc = sk.(teamscores(i)); - s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc)); + s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc, 0)); } } else @@ -912,7 +938,7 @@ void Score_NicePrint_Player(entity to, entity p, float w) { fl = scores_flags(it); sc = sk.(scores(it)); - s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc))); + s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc, 0))); } });