From: havoc Date: Thu, 9 Aug 2007 05:14:40 +0000 (+0000) Subject: don't crash if r_listmaptextures or r_replacemaptexture is used with no X-Git-Tag: xonotic-v0.1.0preview~2959 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=998fd02c42e2948877a27c182c8d4850bc72d52b;p=xonotic%2Fdarkplaces.git don't crash if r_listmaptextures or r_replacemaptexture is used with no world model on the client git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7507 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index 0ce09f6c..1dd4c27c 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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");