]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_map.c
16_ca needs huge amounts of work and I should remember what needs to be done soon...
[16.git] / src / lib / 16_map.c
index 88110d5e2a50f099704feda6236aeb690216e4a9..ad846e81b10bae5149e44ea7effc21606343781a 100755 (executable)
@@ -216,7 +216,6 @@ int newloadmap(char *mn, map_t *map) {
 //======\r
 \r
 \r
-#define MAPBUFINLM (gvar->ca.mapsegs[0])\r
 int CA_loadmap(char *mn, map_t *map, global_game_variables_t *gvar)\r
 {\r
        jsmn_parser p;\r
@@ -230,18 +229,18 @@ 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, (memptr *)&MAPBUFINLM, gvar);\r
-       tokcount = jsmn_parse(&p, (char const *)MAPBUFINLM, file_s, NULL, 0);\r
+       CA_LoadFile(mn, MEMPTRCONV MAPSEGINLM, gvar);\r
+       tokcount = jsmn_parse(&p, (char const *)MAPSEGINLM, 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 *)MAPBUFINLM, file_s, tok, tokcount)) < 0)\r
+       if((status = jsmn_parse(&p, (char const *)MAPSEGINLM, 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 *)MAPBUFINLM, tok, tokcount, map);\r
+       extract_map((char const *)MAPSEGINLM, tok, tokcount, map);\r
 \r
        free(tok);      //TODO: USE MM_ CA_ AND PM_\r
        fclose(fh);     //TODO: USE MM_ CA_ AND PM_\r