changed Mod_Q3BSP_LoadEffects to allow brushindex -1 (for effects applied to the...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Sep 2005 17:41:03 +0000 (17:41 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Sep 2005 17:41:03 +0000 (17:41 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5695 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 430de3f..6e46b5f 100644 (file)
@@ -4119,8 +4119,11 @@ static void Mod_Q3BSP_LoadEffects(lump_t *l)
        {
                strlcpy (out->shadername, in->shadername, sizeof (out->shadername));
                n = LittleLong(in->brushindex);
-               if (n < 0 || n >= loadmodel->brush.num_brushes)
-                       Host_Error("Mod_Q3BSP_LoadEffects: invalid brushindex %i (%i brushes)\n", n, loadmodel->brush.num_brushes);
+               if (n >= loadmodel->brush.num_brushes)
+               {
+                       Con_Printf("Mod_Q3BSP_LoadEffects: invalid brushindex %i (%i brushes), setting to -1\n", n, loadmodel->brush.num_brushes);
+                       n = -1;
+               }
                out->brushindex = n;
                out->unknown = LittleLong(in->unknown);
        }