]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Hack: only check one flag per team (fixes some oddities, but also means you may not...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 17c56fb543dd167e3f8302bf8155efb79e2323ab..eace0ee5995b0b20d42417c20a6dd860105c18d0 100644 (file)
@@ -1,7 +1,8 @@
 #include "scores.qh"
 
 #include "command/common.qh"
-#include "mutators/all.qh"
+#include "mutators/_mod.qh"
+#include <common/net_linked.qh>
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
 
@@ -98,20 +99,20 @@ float TeamScore_AddToTeam(float t, float scorefield, float score)
 {
        entity s;
 
-       if(gameover)
+       if(game_stopped)
                score = 0;
 
        if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
        if(t <= 0 || t >= 16)
        {
-               if(gameover)
+               if(game_stopped)
                        return 0;
                error("Adding score to invalid team!");
        }
        s = teamscorekeepers[t - 1];
        if(!s)
        {
-               if(gameover)
+               if(game_stopped)
                        return 0;
                error("Adding score to unknown team!");
        }
@@ -185,7 +186,7 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
 {
        float i;
        WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
-       WriteInt24_t(MSG_ENTITY, MapInfo_LoadedGametype);
+       WriteRegistered(Gametypes, MSG_ENTITY, MapInfo_LoadedGametype);
        FOREACH(Scores, true, {
                WriteString(MSG_ENTITY, scores_label(it));
                WriteByte(MSG_ENTITY, scores_flags(it));
@@ -323,7 +324,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
        score = M_ARGV(1, float);
 
-       if(gameover)
+       if(game_stopped)
        if(!mutator_returnvalue)
                score = 0;
 
@@ -331,9 +332,9 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        entity s = player.scorekeeper;
        if(!s)
        {
-               if(gameover)
+               if(game_stopped)
                        return 0;
-               LOG_WARNING("Adding score to unknown player!");
+               LOG_WARN("Adding score to unknown player!");
                return 0;
        }
        if(score)
@@ -746,7 +747,7 @@ float TeamScore_GetCompareValue(float t)
 
        if(t <= 0 || t >= 16)
        {
-               if(gameover)
+               if(game_stopped)
                        return 0;
                error("Reading score of invalid team!");
        }
@@ -823,7 +824,7 @@ void Score_NicePrint_Player(entity to, entity p, float w)
 
        sk = p.scorekeeper;
 
-       s = strcat(s, p.netname);
+       s = strcat(s, playername(p, false));
        for (;;)
        {
                i = strlennocol(s) - NAMEWIDTH;
@@ -855,7 +856,7 @@ void Score_NicePrint_Spectators(entity to)
 
 void Score_NicePrint_Spectator(entity to, entity p)
 {
-       print_to(to, strcat("  ", p.netname));
+       print_to(to, strcat("  ", playername(p, false)));
 }
 
 .float score_dummyfield;