]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_map.c
xcroll fuckings please ignore and go to e9a094cdce9001737f17d3961f49f27272dff4e4
[16.git] / src / lib / 16_map.c
old mode 100755 (executable)
new mode 100644 (file)
index 2d266df..e598d36
@@ -216,6 +216,7 @@ int newloadmap(char *mn, map_t *map) {
 //======\r
 \r
 \r
+#define MAPBUFINLM *(gvar->ca.mapsegs)\r
 int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar)\r
 {\r
        jsmn_parser p;\r
@@ -229,22 +230,20 @@ int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar)
        jsmn_init(&p);\r
 \r
        file_s = filesize(fh);\r
-       CA_LoadFile(mn, MEMPTRCONV MAPSEGINLM, gvar);\r
-       tokcount = jsmn_parse(&p, (char const *)MAPSEGINLM, file_s, NULL, 0);\r
+       CA_LoadFile(mn, (memptr *)&MAPBUFINLM, gvar);\r
+       tokcount = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, NULL, 0);\r
        tok = malloc(tokcount*sizeof(jsmntok_t));//TODO: USE MM_ CA_ AND PM_\r
 //     printf("Allocated %d tokens", tokcount);\r
        jsmn_init(&p);\r
-       if((status = jsmn_parse(&p, (char const *)MAPSEGINLM, file_s, tok, tokcount)) < 0)\r
+       if((status = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, tok, tokcount)) < 0)\r
        {\r
                printf("Error: %d\n", status);\r
                return status;\r
        }\r
        else if(status != tokcount) { printf("Warning: used %d tok\n", status);}\r
-       extract_map((char const *)MAPSEGINLM, tok, tokcount, map);\r
+       extract_map((char const *)MAPBUFINLM, tok, tokcount, map);\r
 \r
-//     printf("freeing tok\n");\r
        free(tok);      //TODO: USE MM_ CA_ AND PM_\r
-//     printf("fclose fh\n");\r
        fclose(fh);     //TODO: USE MM_ CA_ AND PM_\r
 \r
        return 0;\r