From 998fd02c42e2948877a27c182c8d4850bc72d52b Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 9 Aug 2007 05:14:40 +0000 Subject: [PATCH] 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 --- gl_rsurf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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"); -- 2.39.2