]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/Main.qc
Merge remote branch 'origin/master' into mirceakitsune/damage_effects
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / Main.qc
index a57888e7065e4a65b467bfbc707554e097e7e8c8..f2f5ac86dc24b8ab339691071925d43d766c7193 100644 (file)
@@ -139,7 +139,9 @@ void CSQC_Init(void)
 
        GetTeam(COLOR_SPECTATOR, true); // add specs first
 
+       // needs to be done so early because of the constants they create
        RegisterWeapons();
+       RegisterGametypes();
 
        WaypointSprite_Load();
 
@@ -194,11 +196,16 @@ void CSQC_Init(void)
 
        hud_configure_prev = -1;
        tab_panel = -1;
+
+
+       precache_model("models/null.md3");
+
+       draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));
+
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
-float cvar_clientsettemp_restore();
-void CSQC_Shutdown(void)
+void Shutdown(void)
 {
 #ifdef USE_FTE
 #pragma TARGET id
@@ -219,8 +226,6 @@ void CSQC_Shutdown(void)
                db_save(ClientProgsDB, "client.db");
        db_close(ClientProgsDB);
 
-       cvar_clientsettemp_restore();
-
        if(camera_active)
                cvar_set("chase_active",ftos(chase_active_backup));
 
@@ -751,7 +756,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
                case ENT_CLIENT_TURRET: ent_turret(); break; 
-               case ENT_CLIENT_MODEL: CSQCModel_Read(); break; 
+               case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break; 
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
@@ -786,7 +791,7 @@ void Gamemode_Init()
 {
        if not(isdemo())
        {
-               localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), "\n");
+               localcmd("\n_cl_hook_gamestart ", MapInfo_Type_ToString(gametype), "\n");
                calledhooks |= HOOK_START;
        }
 }
@@ -822,7 +827,7 @@ void Ent_ScoresInfo()
 {
        float i;
        self.classname = "ent_client_scores_info";
-       gametype = ReadByte();
+       gametype = ReadInt24_t();
        for(i = 0; i < MAX_SCORE; ++i)
        {
                scores_label[i] = strzone(ReadString());