home · contact · privacy
Load last world state from save file, not from re-stepping record file.
[plomrogue] / src / server / map.c
index 1c9a2f1881fdbac990dcd48ffe3bc9232aaa479d..059a7133134cea14f0c4343241f05fba373daf84 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "map.h"
 #include <stdint.h> /* uint8_t, uint16_t, uint32_t, UINT16_MAX */
+#include <stdlib.h> /* free() */
 #include "../common/rexit.h" /* exit_err() */
 #include "../common/try_malloc.h" /* try_malloc() */
 #include "../common/yx_uint8.h" /* struct yx_uint8 */
@@ -136,13 +137,17 @@ static void make_trees()
 
 
 
-extern void init_map()
+extern void remake_map()
 {
     char * f_name = "init_map()";
+    free(world.map.cells);
     world.map.cells = try_malloc(world.map.length * world.map.length, f_name);
+    uint32_t store_seed = world.seed;
+    world.seed = world.seed_map;
     make_sea();
     make_island();
     make_trees();
+    world.seed = store_seed;
 }