]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Revert compat hack
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 17c56fb543dd167e3f8302bf8155efb79e2323ab..c0ebfc54a6335da48be50c0798035412cd1cf797 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,26 +99,26 @@ 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!");
        }
        if(score)
                if(teamscores_label(scorefield) != "")
-                       s.SendFlags |= pow(2, scorefield);
+                       s.SendFlags |= (2 ** scorefield);
        return (s.(teamscores(scorefield)) += score);
 }
 
@@ -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));
@@ -264,7 +265,7 @@ float PlayerScore_Clear(entity player)
        FOREACH(Scores, true, {
                if(sk.(scores(it)) != 0)
                        if(scores_label(it) != "")
-                               sk.SendFlags |= pow(2, i % 16);
+                               sk.SendFlags |= (2 ** (i % 16));
                sk.(scores(it)) = 0;
        });
 
@@ -281,7 +282,7 @@ void Score_ClearAll()
                FOREACH(Scores, true, {
                        if(sk.(scores(it)) != 0)
                                if(scores_label(it) != "")
-                                       sk.SendFlags |= pow(2, i % 16);
+                                       sk.SendFlags |= (2 ** (i % 16));
                        sk.(scores(it)) = 0;
                });
        });
@@ -294,7 +295,7 @@ void Score_ClearAll()
                {
                        if(sk.(teamscores(j)) != 0)
                                if(teamscores_label(j) != "")
-                                       sk.SendFlags |= pow(2, j);
+                                       sk.SendFlags |= (2 ** j);
                        sk.(teamscores(j)) = 0;
                }
        }
@@ -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,14 +332,14 @@ 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)
                if(scores_label(scorefield) != "")
-                       s.SendFlags |= pow(2, scorefield.m_id % 16);
+                       s.SendFlags |= (2 ** (scorefield.m_id % 16));
        if(!warmup_stage)
                PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        return (s.(scores(scorefield)) += 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;