X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fmain.c;h=457143847899e17e4257b68843a108fd3cdd5f3b;hb=3a4e6fcaf5e774cda536d46e10287fcf8a1dfe85;hp=86f8507869cd3e28899b67dde5ed97ed59a9b348;hpb=2dccba703435158681552b8a8aefccab79eb13f3;p=plomrogue
diff --git a/src/main.c b/src/main.c
index 86f8507..4571438 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,10 +20,9 @@
#include "map.h" /* for struct Map, init_map() */
#include "misc.h" /* for update_log(), find_passable_pos(), save_game(),
* try_calloc(), check_tempfile(), check_xor_files(),
- * load_interface_conf(), load_game()
+ * load_interface_conf(), load_game(), rrand()
*/
#include "wincontrol.h" /* get_win_by_id(), get_winconf_by_win() */
-#include "rrand.h" /* for rrand(), rrand_seed() */
#include "rexit.h" /* for exit_game(), exit_err() */
#include "command_db.h" /* for init_command_db(), is_command_id_shortdsc() */
#include "control.h" /* for control_by_id(), player_control(),
@@ -127,12 +126,14 @@ int main(int argc, char *argv[])
exit_err(write_uint32_bigendian(world.seed, file), err_w);
try_fclose_unlink_rename(file, recordfile_tmp, recordfile, f_name);
}
+ world.mapseed = world.seed;
}
/* Generate map from seed and, if newly generated world, start positions of
* actors.
*/
- rrand_seed(world.seed);
+ uint32_t restore_seed = world.seed;
+ world.seed = world.mapseed;
struct Map map = init_map();
world.map = ↦
set_cleanup_flag(CLEANUP_MAP);
@@ -148,18 +149,17 @@ int main(int argc, char *argv[])
set_cleanup_flag(CLEANUP_MAP_OBJECTS);
world.turn = 1;
}
+ world.seed = restore_seed;
/* Initialize window system and windows. */
- WINDOW * screen = initscr();
+ init_win_meta();
set_cleanup_flag(CLEANUP_NCURSES);
noecho();
curs_set(0);
- keypad(screen, TRUE);
+ keypad(world.wmeta->screen, TRUE);
raw();
- init_win_meta(screen);
- set_cleanup_flag(CLEANUP_WIN_META);
load_interface_conf();
- set_cleanup_flag(CLEANUP_INTERFACE_CONF);
+ set_cleanup_flag(CLEANUP_INTERFACE);
/* Focus map on player. */
struct MapObj * player = get_player();