]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't crash if r_listmaptextures or r_replacemaptexture is used with no
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Aug 2007 05:14:40 +0000 (05:14 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Aug 2007 05:14:40 +0000 (05:14 +0000)
world model on the client

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7507 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c

index 0ce09f6ca9e9cf46781118c2e1ccec5a012d8b76..1dd4c27c7a8408181de47dbb2c67089cf0c26db0 100644 (file)
@@ -1144,6 +1144,11 @@ void R_ReplaceWorldTexture (void)
        int                     i;
        const char      *r, *newt;
        skinframe_t *skinframe;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        if(Cmd_Argc() < 2)
@@ -1186,6 +1191,11 @@ void R_ListWorldTextures (void)
        model_t         *m;
        texture_t       *t;
        int                     i;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        Con_Print("Worldmodel textures :\n");