Don't let envmap run if we're not in-game. Fixes crash
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 May 2020 22:26:33 +0000 (22:26 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 May 2020 22:26:33 +0000 (22:26 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12617 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c

index f6ca6e1..66c5005 100644 (file)
@@ -1820,6 +1820,11 @@ static void R_Envmap_f(cmd_state_t *cmd)
                return;
        }
 
+       if(cls.state != ca_connected) {
+               Con_Printf("envmap: No map loaded\n");
+               return;
+       }
+
        strlcpy (basename, Cmd_Argv(cmd, 1), sizeof (basename));
        size = atoi(Cmd_Argv(cmd, 2));
        if (size != 128 && size != 256 && size != 512 && size != 1024)