if a skyboxskinframe is missing, don't draw that sky surface (fixes crash if some...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Dec 2010 06:46:40 +0000 (06:46 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Dec 2010 06:46:40 +0000 (06:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10665 d7cf8633-e32d-0410-b094-e92efae38249

r_sky.c

diff --git a/r_sky.c b/r_sky.c
index 388316a..4aa4d7f 100644 (file)
--- a/r_sky.c
+++ b/r_sky.c
@@ -302,7 +302,8 @@ static void R_SkyBox(void)
        int i;
        RSurf_ActiveCustomEntity(&skymatrix, &skyinversematrix, 0, 0, 1, 1, 1, 1, 6*4, skyboxvertex3f, skyboxtexcoord2f, NULL, NULL, NULL, NULL, 6*2, skyboxelement3i, skyboxelement3s, false, false);
        for (i = 0;i < 6;i++)
-               R_DrawCustomSurface(skyboxskinframe[i], &identitymatrix, MATERIALFLAG_SKY | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE | MATERIALFLAG_NODEPTHTEST, i*4, 4, i*2, 2, false, false);
+               if(skyboxskinframe[i])
+                       R_DrawCustomSurface(skyboxskinframe[i], &identitymatrix, MATERIALFLAG_SKY | MATERIALFLAG_FULLBRIGHT | MATERIALFLAG_NOCULLFACE | MATERIALFLAG_NODEPTHTEST, i*4, 4, i*2, 2, false, false);
 }
 
 #define skygridx 32