X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=de298e220c5b34e0e8b6fa1fcb59eb569475bb0c;hb=dc02e4d78fb0e67b47a0c1e150b4c18c0711b8bf;hp=2cb40a83492d88f454622f2c6dc9a6a47b7a7d15;hpb=0076d3f631e54b908b7506883c75c6d28f6b9505;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 2cb40a834..de298e220 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -1,10 +1,13 @@ #include "scores.qh" #include "command/common.qh" -#include "defs.qh" -#include +#include +#include "client.qh" +#include +#include #include #include +#include #include #include "../common/playerstats.qh" #include "../common/teams.qh" @@ -108,7 +111,9 @@ float TeamScore_AddToTeam(int t, float scorefield, float score) entity s; if(game_stopped) + { score = 0; + } if(!scores_initialized) return 0; // FIXME remove this when everything uses this system if(t <= 0 || t >= 16) @@ -334,9 +339,10 @@ 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) + { score = 0; + } if(!scores_initialized) return 0; // FIXME remove this when everything uses this system entity s = CS(player).scorekeeper; @@ -402,7 +408,7 @@ float PlayerScore_Compare(entity t1, entity t2, float strict) }); if (result.x == 0 && strict) - result.x = etof(t1.owner) - etof(t2.owner); + result.x = t1.owner.playerid - t2.owner.playerid; return result.x; } @@ -857,7 +863,7 @@ void Score_NicePrint_Player(entity to, entity p, float w) sk = CS(p).scorekeeper; - s = strcat(s, playername(p, false)); + s = strcat(s, playername(p.netname, p.team, false)); for (;;) { i = strlennocol(s) - NAMEWIDTH; @@ -889,7 +895,7 @@ void Score_NicePrint_Spectators(entity to) void Score_NicePrint_Spectator(entity to, entity p) { - print_to(to, strcat(" ", playername(p, false))); + print_to(to, strcat(" ", playername(p.netname, p.team, false))); } .float score_dummyfield;