]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host_cmd.c
autocvars: update to current value after loading a savegame, to always fulfill the...
[xonotic/darkplaces.git] / host_cmd.c
index 957ab8626a0e3fc82086113970d57456f881ad2a..202e4d98837545e80f451366f854af79b9a7cca2 100644 (file)
@@ -174,8 +174,14 @@ void Host_Status_f (void)
                
                if (in == 0) // default layout
                {
-                       print ("#%-3u %-16.16s  %3i  %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
-                       print ("   %s\n", ip);
+                       // LordHavoc: we must use multiple prints for ProQuake compatibility
+                       print ("#%-3u ", i+1);
+                       print ("%-16.16s ", client->name);
+                       print ("%4i  ", frags);
+                       print ("%2i:%02i:%02i\n   ", hours, minutes, seconds);
+                       print ("%s\n", ip);
+//                     print ("#%-3u %-16.16s  %3i  %2i:%02i:%02i\n", i+1, client->name, frags, hours, minutes, seconds);
+//                     print ("   %s\n", ip);
                }
                else if (in == 1) // extended layout
                {
@@ -368,6 +374,8 @@ void Host_Map_f (void)
        }
 
        // remove menu
+       if (key_dest == key_menu || key_dest == key_menu_grabbed)
+               MR_ToggleMenu(0);
        key_dest = key_game;
 
        svs.serverflags = 0;                    // haven't completed an episode yet
@@ -401,6 +409,8 @@ void Host_Changelevel_f (void)
        }
 
        // remove menu
+       if (key_dest == key_menu || key_dest == key_menu_grabbed)
+               MR_ToggleMenu(0);
        key_dest = key_game;
 
        SV_VM_Begin();
@@ -436,6 +446,8 @@ void Host_Restart_f (void)
        }
 
        // remove menu
+       if (key_dest == key_menu || key_dest == key_menu_grabbed)
+               MR_ToggleMenu(0);
        key_dest = key_game;
 
        allowcheats = sv_cheats.integer != 0;
@@ -768,6 +780,8 @@ void Host_Loadgame_f (void)
                CL_Disconnect ();
 
        // remove menu
+       if (key_dest == key_menu || key_dest == key_menu_grabbed)
+               MR_ToggleMenu(0);
        key_dest = key_game;
 
        cls.demonum = -1;               // stop demo loop in case this fails
@@ -910,6 +924,9 @@ void Host_Loadgame_f (void)
 
                        // parse the global vars
                        PRVM_ED_ParseGlobals (start);
+
+                       // restore the autocvar globals
+                       Cvar_UpdateAllAutoCvars();
                }
                else
                {
@@ -985,7 +1002,7 @@ void Host_Loadgame_f (void)
                                        if (i >= 0 && i < MAX_MODELS)
                                        {
                                                strlcpy(sv.model_precache[i], com_token, sizeof(sv.model_precache[i]));
-                                               sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, sv.model_precache[i][0] == '*' ? sv.modelname : NULL);
+                                               sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, sv.model_precache[i][0] == '*' ? sv.worldname : NULL);
                                        }
                                        else
                                                Con_Printf("unsupported model %i \"%s\"\n", i, com_token);