X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/git-logo.png?a=blobdiff_plain;f=src%2Fmain.c;h=06156fc5b01f3cd117de54dad1051044d0e79c95;hb=70e61f84d109d0f3072ab569774424b83136ae58;hp=5d253ce186f58b55fd8d3c4e60014850578cb9d0;hpb=8e38bb5605a46afd6398b69c63c935aa5dc83660;p=plomrogue diff --git a/src/main.c b/src/main.c index 5d253ce..06156fc 100644 --- a/src/main.c +++ b/src/main.c @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) struct Player player; player.hitpoints = 5; world.player = &player; - init_map_object_defs(&world, "config/defs2"); + init_map_object_defs(&world, "config/defs"); set_cleanup_flag(CLEANUP_MAP_OBJECT_DEFS); world.map_obj_count = 1; @@ -138,12 +138,12 @@ int main(int argc, char *argv[]) if (0 == world.turn) { player.pos = find_passable_pos(world.map); - struct MapObj ** ptr; - ptr = build_map_objects(&world, &world.map_objs, 1, 1 + rrand() % 27); - ptr = build_map_objects(&world, ptr, 2, 1 + rrand() % 9); - ptr = build_map_objects(&world, ptr, 3, 1 + rrand() % 3); - ptr = build_map_objects(&world, ptr, 4, 1 + rrand() % 3); - ptr = build_map_objects(&world, ptr, 5, 1 + rrand() % 3); + world.map_objs = NULL; + add_map_objects(&world, 1, 1 + rrand() % 27); + add_map_objects(&world, 2, 1 + rrand() % 9); + add_map_objects(&world, 3, 1 + rrand() % 3); + add_map_objects(&world, 4, 1 + rrand() % 3); + add_map_objects(&world, 5, 1 + rrand() % 3); set_cleanup_flag(CLEANUP_MAP_OBJECTS); world.turn = 1; }