]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
added Q1 BSP2 format support, compatible with hmap2
[xonotic/darkplaces.git] / console.c
index 46b5840574c8922873cec49da297d7948af55bc0..4011ae10eb2c9d645bd7c7fb0cc759abc82d7366 100644 (file)
--- a/console.c
+++ b/console.c
@@ -2056,11 +2056,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;