newmap bug fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6652 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+10
-10
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user