]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix defer command. Maintain separate oldrealtime(s) per interpreter
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 May 2020 19:16:31 +0000 (19:16 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 27 May 2020 19:16:31 +0000 (19:16 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12602 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c
cmd.h

diff --git a/cmd.c b/cmd.c
index 83ff546c212d8c93f1fd6abd5ae2d2feb054a68d..352d8c5be40491efe542a7d84a26b2411a41882f 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -237,14 +237,13 @@ Cbuf_Execute_Deferred --blub
 */
 static void Cbuf_Execute_Deferred (cmd_state_t *cmd)
 {
-       static double oldrealtime = 0;
        cmddeferred_t *defcmd, *prev;
        double eat;
-       if (realtime - oldrealtime < 0 || realtime - oldrealtime > 1800) oldrealtime = realtime;
-       eat = realtime - oldrealtime;
+       if (realtime - cmd->deferred_oldrealtime < 0 || realtime - cmd->deferred_oldrealtime > 1800) cmd->deferred_oldrealtime = realtime;
+       eat = realtime - cmd->deferred_oldrealtime;
        if (eat < (1.0 / 120.0))
                return;
-       oldrealtime = realtime;
+       cmd->deferred_oldrealtime = realtime;
        prev = NULL;
        defcmd = cmd->deferred_list;
        while(defcmd)
diff --git a/cmd.h b/cmd.h
index 98057fa82324419a9e4455e8f0c07894dde2f440..02871000ec78e54e4d88897d450fb7e2c22f58b4 100644 (file)
--- a/cmd.h
+++ b/cmd.h
@@ -98,6 +98,7 @@ typedef struct cmd_state_s
        int tokenizebufferpos;
 
        cmddeferred_t *deferred_list;
+       double deferred_oldrealtime;
 
        sizebuf_t text;
        unsigned char text_buf[CMDBUFSIZE];