synchronize newmap command across clients

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3012 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-10-14 19:44:55 +00:00
parent 2ad7aa7111
commit ebcf3f46b8
6 changed files with 20 additions and 9 deletions
+5 -4
View File
@@ -286,9 +286,9 @@ void setupworld(int factor)
loopi(LARGEST_FACTOR*2) { wmip[i] = w; w += cubicsize>>(i*2); }
}
void empty_world(int factor, bool force) // main empty world creation routine, if passed factor -1 will enlarge old world by 1
bool empty_world(int factor, bool force) // main empty world creation routine, if passed factor -1 will enlarge old world by 1
{
if(!force && noteditmode()) return;
if(!force && noteditmode()) return false;
sqr *oldworld = world;
bool copy = false;
if(oldworld && factor<0) { factor = sfactor+1; copy = true; }
@@ -360,10 +360,11 @@ void empty_world(int factor, bool force) // main empty world creation routine
findplayerstart(player1, true);
startmap("");
}
return true;
}
void mapenlarge() { empty_world(-1, false); }
void newmap(int i) { empty_world(i, false); }
void mapenlarge() { if(empty_world(-1, false)) addmsg(SV_NEWMAP, "ri", -1); }
void newmap(int i) { if(empty_world(i, false)) addmsg(SV_NEWMAP, "ri", max(i, 0)); }
COMMAND(mapenlarge, ARG_NONE);
COMMAND(newmap, ARG_1INT);