]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
Reimpl. the cvar alias system. Reimpl. the cvar hash table as a distinct type
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 9a3d6ace0e82e46c5b88912b6933fc2be41d54d2..5c6af792322dfd2aad3691e544a429de462322f2 100644 (file)
--- a/host.c
+++ b/host.c
@@ -747,8 +747,6 @@ void Host_Main(void)
                        }
                }
 
-               if (slowmo.value < 0.00001 && slowmo.value != 0)
-                       Cvar_SetValueQuick(&slowmo, 0);
                if (host_framerate.value < 0.00001 && host_framerate.value != 0)
                        Cvar_SetValueQuick(&host_framerate, 0);
 
@@ -883,8 +881,8 @@ void Host_Main(void)
                                framelimit = cl_maxphysicsframesperserverframe.integer;
                                aborttime = Sys_DirtyTime() + 0.1;
                        }
-                       if(slowmo.value > 0 && slowmo.value < 1)
-                               advancetime = min(advancetime, 0.1 / slowmo.value);
+                       if(host_timescale.value > 0 && host_timescale.value < 1)
+                               advancetime = min(advancetime, 0.1 / host_timescale.value);
                        else
                                advancetime = min(advancetime, 0.1);
 
@@ -901,7 +899,7 @@ void Host_Main(void)
 
                        // only advance time if not paused
                        // the game also pauses in singleplayer when menu or console is used
-                       sv.frametime = advancetime * slowmo.value;
+                       sv.frametime = advancetime * host_timescale.value;
                        if (host_framerate.value)
                                sv.frametime = host_framerate.value;
                        if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive || cl.csqc_paused)))
@@ -982,7 +980,7 @@ void Host_Main(void)
                        // scale playback speed of demos by slowmo cvar
                        if (cls.demoplayback)
                        {
-                               clframetime *= slowmo.value;
+                               clframetime *= host_timescale.value;
                                // if demo playback is paused, don't advance time at all
                                if (cls.demopaused)
                                        clframetime = 0;
@@ -1112,17 +1110,21 @@ static qboolean locksession_run = false;
 static void Host_InitSession(void)
 {
        int i;
+       char *buf;
        Cvar_RegisterVariable(&sessionid);
        Cvar_RegisterVariable(&locksession);
 
        // load the session ID into the read-only cvar
        if ((i = COM_CheckParm("-sessionid")) && (i + 1 < com_argc))
        {
-               char vabuf[1024];
                if(com_argv[i+1][0] == '.')
                        Cvar_SetQuick(&sessionid, com_argv[i+1]);
                else
-                       Cvar_SetQuick(&sessionid, va(vabuf, sizeof(vabuf), ".%s", com_argv[i+1]));
+               {
+                       buf = (char *)Z_Malloc(strlen(com_argv[i+1]) + 2);
+                       dpsnprintf(buf, sizeof(buf), ".%s", com_argv[i+1]);
+                       Cvar_SetQuick(&sessionid, buf);
+               }
        }
 }
 void Host_LockSession(void)
@@ -1166,8 +1168,6 @@ void Host_UnlockSession(void)
        }
 }
 
-extern hook_t *csqc_concmd;
-
 /*
 ====================
 Host_Init
@@ -1237,8 +1237,6 @@ static void Host_Init (void)
        // initialize memory subsystem cvars/commands
        Memory_Init_Commands();
 
-       Hook_Init();
-       csqc_concmd = Hook_Register(csqc_concmd,CL_VM_ConsoleCommand,1);
        // initialize console and logging and its cvars/commands
        Con_Init();