]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Merge branch 'master' into Mario/wepent_experimental
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index b5c841a36bea5a9585408cd48847e763ff6f1550..f48c0c530a40cf631c10c1e54c696d80db6dc741 100644 (file)
@@ -1,7 +1,7 @@
 #include "main.qh"
 
 #include <common/effects/qc/all.qh>
-#include "hud/all.qh"
+#include "hud/_mod.qh"
 #include "mapvoting.qh"
 #include "mutators/events.qh"
 #include "hud/panel/scoreboard.qh"
 #include "wall.qh"
 #include "weapons/projectile.qh"
 #include <common/deathtypes/all.qh>
-#include <common/items/all.qh>
+#include <common/items/_mod.qh>
 #include <common/mapinfo.qh>
 #include <common/minigames/cl_minigames.qh>
 #include <common/minigames/cl_minigames_hud.qh>
+#include <common/net_linked.qh>
 #include <common/net_notice.qh>
 #include <common/triggers/include.qh>
 #include <common/vehicles/all.qh>
@@ -108,7 +109,6 @@ void CSQC_Init()
        binddb = db_create();
        tempdb = db_create();
        ClientProgsDB = db_load("client.db");
-       compressShortVector_init();
 
        draw_endBoldFont();
 
@@ -131,13 +131,7 @@ void CSQC_Init()
 
        registercvar("cl_spawn_near_teammate", "1");
 
-       gametype = 0;
-
-       // sbt_fields uses strunzone on the titles!
-       for(int i = 0; i < MAX_SBT_FIELDS; ++i)
-               sbt_field_title[i] = strzone("(null)");
-
-       Cmd_Scoreboard_SetFields(0);
+       gametype = NULL;
 
        postinit = false;
 
@@ -235,7 +229,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == NULL)
                                {
-                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -251,7 +245,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == NULL)
                                {
-                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -500,16 +494,6 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
 
        spectatorbutton_zoom = (f & 4);
 
-       if(f & 8)
-       {
-               angles_held_status = 1;
-               angles_held.x = ReadAngle();
-               angles_held.y = ReadAngle();
-               angles_held.z = 0;
-       }
-       else
-               angles_held_status = 0;
-
        if(f & 16)
        {
                num_spectators = ReadByte();
@@ -715,7 +699,7 @@ NET_HANDLE(ENT_CLIENT_SPAWNPOINT, bool is_new)
                }*/
                if(autocvar_cl_spawn_point_particles)
                {
-                       if((serverflags & SERVERFLAG_TEAMPLAY))
+                       if(teamplay)
                        {
                                switch(teamnum)
                                {
@@ -845,7 +829,7 @@ void CSQC_Ent_Update(entity this, bool isnew)
        time = savetime;
        if (!done)
        {
-               LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+               LOG_FATALF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
        }
 }
 
@@ -880,7 +864,7 @@ void CSQC_Ent_Remove(entity this)
        if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
        if (wasfreed(this))
        {
-               LOG_WARNING("CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
+               LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?");
                return;
        }
        if (this.enttype) Ent_Remove(this);
@@ -950,7 +934,8 @@ void Gamemode_Init();
 NET_HANDLE(ENT_CLIENT_SCORES_INFO, bool isnew)
 {
        make_pure(this);
-       gametype = ReadInt24_t();
+       gametype = ReadRegistered(Gametypes);
+       teamplay = _MapInfo_GetTeamPlayBool(gametype);
        HUD_ModIcons_SetFunc();
        FOREACH(Scores, true, {
                if (scores_label(it)) strunzone(scores_label(it));