]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Small cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index c66d23ca7c887d10a43dda357177f70ec2b0453c..94bea2b44a662428e8259e36a0b08941f18e91d3 100644 (file)
@@ -1,7 +1,7 @@
 #include "scores.qh"
 
 #include "command/common.qh"
-#include "mutators/all.qh"
+#include "mutators/_mod.qh"
 #include "../common/playerstats.qh"
 #include "../common/teams.qh"
 
@@ -185,7 +185,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));
@@ -198,7 +198,7 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
        return true;
 }
 
-void ScoreInfo_Init(float teams)
+void ScoreInfo_Init(int teams)
 {
        if(scores_initialized)
        {
@@ -209,13 +209,13 @@ void ScoreInfo_Init(float teams)
                scores_initialized = new_pure(ent_client_scoreinfo);
                Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity);
        }
-       if(teams >= 1)
+       if(teams & BIT(0))
                TeamScore_Spawn(NUM_TEAM_1, "Red");
-       if(teams >= 2)
+       if(teams & BIT(1))
                TeamScore_Spawn(NUM_TEAM_2, "Blue");
-       if(teams >= 3)
+       if(teams & BIT(2))
                TeamScore_Spawn(NUM_TEAM_3, "Yellow");
-       if(teams >= 4)
+       if(teams & BIT(3))
                TeamScore_Spawn(NUM_TEAM_4, "Pink");
 }
 
@@ -314,7 +314,7 @@ void PlayerScore_Detach(entity player)
 {
        if(!player.scorekeeper)
                error("player has no scorekeeper");
-       remove(player.scorekeeper);
+       delete(player.scorekeeper);
        player.scorekeeper = NULL;
 }
 
@@ -333,7 +333,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
        {
                if(gameover)
                        return 0;
-               LOG_WARNING("Adding score to unknown player!");
+               LOG_WARN("Adding score to unknown player!");
                return 0;
        }
        if(score)