]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
added Q1 BSP2 format support, compatible with hmap2
[xonotic/darkplaces.git] / console.c
index cd2bc11159bde9a792e63d2c1435358d63835086..e21f2cbfb4c88abb54e51b0f49ad3a4d3a6fc390 100644 (file)
--- a/console.c
+++ b/console.c
@@ -2057,11 +2057,10 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                        lumplen = LittleLong(header->lumps[Q2LUMP_ENTITIES].filelen);
                                }
                        }
-                       else if((p = BuffLittleLong(buf)) == BSPVERSION || p == 30)
+                       else if((p = BuffLittleLong(buf)) == BSPVERSION || p == 30 || !memcmp(buf, "BSP2", 4))
                        {
-                               dheader_t *header = (dheader_t *)buf;
-                               lumpofs = LittleLong(header->lumps[LUMP_ENTITIES].fileofs);
-                               lumplen = LittleLong(header->lumps[LUMP_ENTITIES].filelen);
+                               lumpofs = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES);
+                               lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
                        }
                        else
                                p = 0;