]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
parse gridsize like q3map2 does (less strict)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Dec 2009 18:48:16 +0000 (18:48 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 6 Dec 2009 18:48:16 +0000 (18:48 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9546 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 60dd1bab38a3a9fce11da2752a9d35cd623ad978..c7df1a20270a97c68350f4efcea7a7d9e457ab18 100644 (file)
@@ -4189,13 +4189,21 @@ static void Mod_Q3BSP_LoadEntities(lump_t *l)
                        if (!COM_ParseToken_Simple(&data, false, false))
                                break; // error
                        strlcpy(value, com_token, sizeof(value));
-                       if (!strcmp("gridsize", key))
+                       if (!strcasecmp("gridsize", key)) // this one is case insensitive to 100% match q3map2
                        {
 #if _MSC_VER >= 1400
 #define sscanf sscanf_s
 #endif
+#if 0
                                if (sscanf(value, "%f %f %f", &v[0], &v[1], &v[2]) == 3 && v[0] != 0 && v[1] != 0 && v[2] != 0)
                                        VectorCopy(v, loadmodel->brushq3.num_lightgrid_cellsize);
+#else
+                               VectorSet(v, 64, 64, 128);
+                               if(sscanf(value, "%f %f %f", &v[0], &v[1], &v[2]) != 3)
+                                       Con_Printf("Mod_Q3BSP_LoadEntities: funny gridsize \"%s\" in %s, interpreting as \"%f %f %f\" to match q3map2's parsing\n", value, loadmodel->name, v[0], v[1], v[2]);
+                               if (v[0] != 0 && v[1] != 0 && v[2] != 0)
+                                       VectorCopy(v, loadmodel->brushq3.num_lightgrid_cellsize);
+#endif
                        }
                        else if (!strcmp("deluxeMaps", key))
                        {