]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
progs: Implement builtin #245 (mod) for SSQC and CSQC
[xonotic/darkplaces.git] / sv_main.c
index 6fbd146d1191d3501dbb7d87fbbefc92b6aec496..d60e98e6b516a914e1452175ea0ffeb51161793d 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -1377,7 +1377,7 @@ SV_ModelIndex
 */
 int SV_ModelIndex(const char *s, int precachemode)
 {
-       int i, limit = ((sv.protocol == PROTOCOL_QUAKE || sv.protocol == PROTOCOL_QUAKEDP || sv.protocol == PROTOCOL_NEHAHRAMOVIE || sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3) ? 256 : MAX_MODELS);
+       int i, limit = ((sv.protocol == PROTOCOL_QUAKE || sv.protocol == PROTOCOL_QUAKEDP || sv.protocol == PROTOCOL_NEHAHRAMOVIE) ? 256 : MAX_MODELS);
        char filename[MAX_QPATH];
        if (!s || !*s)
                return 0;
@@ -1440,7 +1440,7 @@ SV_SoundIndex
 */
 int SV_SoundIndex(const char *s, int precachemode)
 {
-       int i, limit = ((sv.protocol == PROTOCOL_QUAKE || sv.protocol == PROTOCOL_QUAKEDP || sv.protocol == PROTOCOL_NEHAHRAMOVIE || sv.protocol == PROTOCOL_NEHAHRABJP || sv.protocol == PROTOCOL_NEHAHRABJP2 || sv.protocol == PROTOCOL_NEHAHRABJP3) ? 256 : MAX_SOUNDS);
+       int i, limit = ((sv.protocol == PROTOCOL_QUAKE || sv.protocol == PROTOCOL_QUAKEDP || sv.protocol == PROTOCOL_NEHAHRAMOVIE || sv.protocol == PROTOCOL_NEHAHRABJP) ? 256 : MAX_SOUNDS);
        char filename[MAX_QPATH];
        if (!s || !*s)
                return 0;
@@ -2480,6 +2480,9 @@ double SV_Frame(double time)
        char vabuf[1024];
        qbool playing = false;
 
+       if(!sv.active)
+               return 0;
+
        if (!svs.threaded)
        {
                svs.perf_acc_sleeptime = host.sleeptime;
@@ -2522,11 +2525,8 @@ double SV_Frame(double time)
                 * Receive packets on each main loop iteration, as the main loop may
                 * be undersleeping due to select() detecting a new packet
                 */
-               if (sv.active)
-               {
-                       NetConn_ServerFrame();
-                       SV_CheckTimeouts();
-               }
+               NetConn_ServerFrame();
+               SV_CheckTimeouts();
        }
 
        /*
@@ -2545,7 +2545,7 @@ double SV_Frame(double time)
                sv_timer = 0.1;
        }
 
-       if (sv.active && sv_timer > 0 && !svs.threaded)
+       if (sv_timer > 0 && !svs.threaded)
        {
                /*
                 * Execute one or more server frames, with an upper limit on how much