From 5dc679a1dbe88fc6be88a8e15234aab4f462cf45 Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 6 Dec 2009 18:51:22 +0000 Subject: [PATCH] if gridsize is parsed wrong and DP would normally abort when loading the map, instead make it ignore the lightgrid and spit out a warning git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9547 d7cf8633-e32d-0410-b094-e92efae38249 --- model_brush.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/model_brush.c b/model_brush.c index c7df1a20..528c59fa 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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)); -- 2.39.2