]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
if gridsize is parsed wrong and DP would normally abort when loading the map, instead...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Dec 2009 18:51:22 +0000 (18:51 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Dec 2009 18:51:22 +0000 (18:51 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9547 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index c7df1a20270a97c68350f4efcea7a7d9e457ab18..528c59fa1a42051178936f0fbe61757f99c1adc8 100644 (file)
@@ -5421,7 +5421,10 @@ static void Mod_Q3BSP_LoadLightGrid(lump_t *l)
        if (l->filelen)
        {
                if (l->filelen < count * (int)sizeof(*in))
-                       Host_Error("Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, (int)(count * sizeof(*in)), loadmodel->brushq3.num_lightgrid_isize[0], loadmodel->brushq3.num_lightgrid_isize[1], loadmodel->brushq3.num_lightgrid_isize[2]);
+               {
+                       Con_Printf("Mod_Q3BSP_LoadLightGrid: invalid lightgrid lump size %i bytes, should be %i bytes (%ix%ix%i)", l->filelen, (int)(count * sizeof(*in)), loadmodel->brushq3.num_lightgrid_isize[0], loadmodel->brushq3.num_lightgrid_isize[1], loadmodel->brushq3.num_lightgrid_isize[2]);
+                       return; // ignore the grid if we cannot understand it
+               }
                if (l->filelen != count * (int)sizeof(*in))
                        Con_Printf("Mod_Q3BSP_LoadLightGrid: Warning: calculated lightgrid size %i bytes does not match lump size %i\n", (int)(count * sizeof(*in)), l->filelen);
                out = (q3dlightgrid_t *)Mem_Alloc(loadmodel->mempool, count * sizeof(*out));