diff --git a/config/menus.cfg b/config/menus.cfg index 4111cf08..bdafc76e 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -127,15 +127,15 @@ alias tmp_mode alias tmp_botmap alias startbotmatch [ - kickallbots addnbot (div $tmp_numbots 2) RVSF $tmp_botskill if ((> (mod $tmp_numbots 2) 0)) [ alias tmp_numbots (+ $tmp_numbots 1) ] [] addnbot (div $tmp_numbots 2) CLA $tmp_botskill ] alias startbotmap [ - disconnect + if $connected [ disconnect ] echo starting botmatch.. + kickallbots sleep 5000 startbotmatch mode $tmp_mode map $tmp_botmap diff --git a/source/src/client.cpp b/source/src/client.cpp index 5765f2ee..d974ca42 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -3,6 +3,8 @@ #include "cube.h" #include "bot/bot.h" +VAR(connected, 1, 0, 0); + ENetHost *clienthost = NULL; ENetPeer *curpeer = NULL, *connpeer = NULL; int connmillis = 0, connattempts = 0, discmillis = 0; @@ -121,6 +123,7 @@ void disconnect(int onlyclean, int async) } curpeer = NULL; discmillis = 0; + connected = 0; conoutf("disconnected"); cleanup = true; } @@ -345,6 +348,7 @@ void gets2c() // get updates from the server disconnect(1); curpeer = connpeer; connpeer = NULL; + connected = 1; conoutf("connected to server"); throttle(); if(rate) setrate(rate); diff --git a/source/src/editing.cpp b/source/src/editing.cpp index f26436b8..13aa1ad1 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -30,7 +30,7 @@ int lastx, lasty, lasth; int lasttype = 0, lasttex = 0; sqr rtex; -VAR(editing,0,0,1); +VAR(editing, 1, 0, 0); void toggleedit() {