X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Fmap.c;h=059a7133134cea14f0c4343241f05fba373daf84;hb=1bfcaf6f47bb2eb06c071e39b6f93c92a15d4de6;hp=1c9a2f1881fdbac990dcd48ffe3bc9232aaa479d;hpb=0438f2fc5df337e4264103a86c1765ace9c6565a;p=plomrogue diff --git a/src/server/map.c b/src/server/map.c index 1c9a2f1..059a713 100644 --- a/src/server/map.c +++ b/src/server/map.c @@ -2,6 +2,7 @@ #include "map.h" #include /* uint8_t, uint16_t, uint32_t, UINT16_MAX */ +#include /* 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; }