temporarily ensure arg1 of /newmap is within a sane valid range (6-9)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-04-27 23:32:40 +00:00
parent 1c1c1d8aff
commit 001af391bb
3 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -500,10 +500,14 @@ 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(empty_world(i, false))
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
{
addmsg(SV_NEWMAP, "ri", max(i, 0));
if(identexists("onNewMap")) execute("onNewMap");
if(empty_world(i, false))
{
addmsg(SV_NEWMAP, "ri", max(i, 0));
if(identexists("onNewMap")) execute("onNewMap");
}
}
}