home · contact · privacy
Individual map objects are now identified by unique numbers stored in the savefiles...
[plomrogue] / src / main.c
index 457aae5a35779b0f75907c689b5f6a78093b387f..2c096aef69d6f3450d0b5fa718ee67f661d0cd0d 100644 (file)
@@ -22,7 +22,7 @@
                    * try_calloc(), check_tempfile(), check_xor_files()
                    */
 #include "wincontrol.h" /* for create_winconfs(), init_winconfs(), init_wins(),
-                         * sorted_wintoggle()
+                         * sorted_wintoggle_and_activate()
                          */
 #include "rrand.h" /* for rrand(), rrand_seed() */
 #include "rexit.h" /* for exit_game(), exit_err() */
@@ -94,6 +94,7 @@ int main(int argc, char *argv[])
     world.item = 0;
     init_map_object_defs(&world, "config/defs");
     set_cleanup_flag(CLEANUP_MAP_OBJECT_DEFS);
+    world.map_object_count = 1;
 
     /* For interactive mode, try to load world state from savefile. */
     char * err_r = "Trouble loading game (in main()) / "
@@ -184,9 +185,13 @@ int main(int argc, char *argv[])
     init_winconfs(&world);
     init_wins(&world);
     set_cleanup_flag(CLEANUP_WINCONFS);
-    sorted_wintoggle(&world);
+    sorted_wintoggle_and_activate(&world);
     err_winmem = "Trouble with draw_all_wins() in main().";
 
+    /* Focus map on player. */
+    struct Win * win_map = get_win_by_id(&world, 'm');
+    map_center_player(&map, &player, win_map->frame.size);
+
     /* Replay mode. */
     int key;
     struct WinConf * wc;