X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=0769a4f038021e85b09ebabb757090c482de98a6;hb=30c2a7ce2756cb823ec15a71478fa2a4efac6d49;hp=eb305e72203d48462e505a7a9261622660a5f2f1;hpb=b8c629df9a66ec47cbef42054b958d6a2363aa6a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index eb305e722..0769a4f03 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -171,6 +171,11 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags) teamscores_primary = teamscores[i]; teamscores_flags_primary = scoreflags; } + if(label != "") + { + PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label)); + PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label)); + } } float ScoreInfo_SendEntity(entity to, float sf) @@ -256,8 +261,8 @@ float PlayerScore_Clear(entity player) if(teamscores_entities_count) return 0; - if(g_lms) return 0; - if(g_arena || g_ca) return 0; + if(MUTATOR_CALLHOOK(ForbidPlayerScore_Clear)) return 0; + if(g_cts) return 0; // in CTS, you don't lose score by observing if(g_race && g_race_qualifying) return 0; // in qualifying, you don't lose score by observing @@ -393,15 +398,15 @@ void WinningConditionHelper() // so to match pure, match for :P0: // to match full, match for :S0: + fullstatus = autocvar_g_full_getstatus_responses; + s = GetGametype(); s = strcat(s, ":", autocvar_g_xonoticversion); s = strcat(s, ":P", ftos(cvar_purechanges_count)); s = strcat(s, ":S", ftos(nJoinAllowed(world))); s = strcat(s, ":F", ftos(serverflags)); s = strcat(s, ":M", modname); - s = strcat(s, "::", GetPlayerScoreString(world, 1)); // make this 1 once we can, note: this doesn't contain any : - - fullstatus = autocvar_g_full_getstatus_responses; + s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2))); if(teamscores_entities_count) { @@ -523,16 +528,16 @@ void WinningConditionHelper() if(fullstatus) { s = GetPlayerScoreString(p, 1); - if(clienttype(p) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(p)) s = strcat(s, ":human"); else s = strcat(s, ":bot"); - if(p.classname != "player" && !g_arena && !g_ca && !g_lms) + if(!IS_PLAYER(p) && !g_arena && p.caplayer != 1 && !g_lms) s = strcat(s, ":spectator"); } else { - if(p.classname == "player" || g_arena || g_ca || g_lms) + if(IS_PLAYER(p) || g_arena || p.caplayer == 1 || g_lms) s = GetPlayerScoreString(p, 2); else s = "-666"; @@ -622,7 +627,7 @@ string GetTeamScoreString(float tm, float shortString) if(tm == 0) { // label - for(i = 0; i < MAX_SCORE; ++i) + for(i = 0; i < MAX_TEAMSCORE; ++i) if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY) { f = teamscores_flags[i]; @@ -630,7 +635,7 @@ string GetTeamScoreString(float tm, float shortString) out = strcat(out, GetScoreLogLabel(l, f), ","); } if(shortString < 2) - for(i = 0; i < MAX_SCORE; ++i) + for(i = 0; i < MAX_TEAMSCORE; ++i) if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY) { f = teamscores_flags[i]; @@ -638,7 +643,7 @@ string GetTeamScoreString(float tm, float shortString) out = strcat(out, GetScoreLogLabel(l, f), ","); } if(shortString < 1) - for(i = 0; i < MAX_SCORE; ++i) + for(i = 0; i < MAX_TEAMSCORE; ++i) if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY) if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY) { @@ -894,7 +899,7 @@ void Score_NicePrint(entity to) t = 0; FOR_EACH_CLIENT(p) - if(p.classname != "player") + if not(IS_PLAYER(p)) { if not(t) Score_NicePrint_Spectators(to); @@ -927,6 +932,7 @@ void PlayerScore_TeamStats(void) for(i = 0; i < MAX_TEAMSCORE; ++i) if(sk.(teamscores[i]) != 0) if(teamscores_label[i] != "") - PlayerStats_TeamScore(t, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i])); + // the +1 is important here! + PlayerStats_TeamScore(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i])); } }