diff --git a/source/src/world.cpp b/source/src/world.cpp index 88d5a4d0..44731e5a 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -435,7 +435,10 @@ bool empty_world(int factor, bool force) // main empty world creation routine bool clearmap = !copy && world; if(copy) ow = blockcopy(shrink ? bs : be); + extern char *mlayout; DELETEA(world); + DELETEA(mlayout); + setupworld(factor); loop(x,ssize) loop(y,ssize) { @@ -503,18 +506,15 @@ bool empty_world(int factor, bool force) // main empty world creation routine void mapenlarge() { if(empty_world(-1, false)) addmsg(SV_NEWMAP, "ri", -1); } void mapshrink() { if(empty_world(-2, false)) addmsg(SV_NEWMAP, "ri", -2); } -void newmap(int i) { - if(i < 6 || i > 9) conoutf("\f3Error: \f5newmap has a valid range of \f26-9"); // TODO: update this valid range when /newmap >9 stops crashing the client ;) - Bukz 2011apr27 - else +void newmap(int i) +{ + if(empty_world(i, false)) { - if(empty_world(i, false)) - { - addmsg(SV_NEWMAP, "ri", max(i, 0)); - if(identexists("onNewMap")) execute("onNewMap"); - } - defformatstring(startmillis)("%d", millis_()); - alias("gametimestart", startmillis); + addmsg(SV_NEWMAP, "ri", max(i, 0)); + if(identexists("onNewMap")) execute("onNewMap"); } + defformatstring(startmillis)("%d", millis_()); + alias("gametimestart", startmillis); } COMMAND(mapenlarge, ARG_NONE);