fix empty map name after /newmap and fix voting for nonexistent maps

now /savemap after /newmap saves to "newmap.cgz" instead of ".cgz"

also, voting for a nonexistent map in singleplayer leaves the client in
some sort of a broken state. this fix blocks the vote.

and: newmap is blocked in bot modes, since that isn't working stable.
This commit is contained in:
ac-stef
2014-05-14 22:39:57 +02:00
parent 23d04ffec6
commit 5058172a06
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -538,7 +538,7 @@ bool empty_world(int factor, bool force) // main empty world creation routine
if(!copy)
{
findplayerstart(player1, true);
startmap("", false);
startmap("newmap", false);
}
else conoutf("new map size: %d", sfactor);
freeblock(ow);
@@ -549,6 +549,7 @@ 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(m_botmode) { conoutf("newmap not supported in bot mode"); return; }
if(empty_world(*i, false))
{
addmsg(SV_NEWMAP, "ri", max(*i, 0));