diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 5dd5b6bc..cf9ce8c1 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -16,6 +16,35 @@ void mode(int n) } COMMAND(mode, ARG_1INT); +void setbottimeout(int m, int t) +{ + if(m==1 || m==2) + { + if(t>0 && t<61) + { + switch(m) + { + case 1: + { + extern int botmatch_dm_minremain; + botmatch_dm_minremain = t; + break; + } + case 2: + { + extern int botmatch_tm_minremain; + botmatch_tm_minremain = t; + break; + } + default: break; + } + } + else conoutf("time is not >=1 or <=60"); + } + else conoutf("mode needs to be 1 for DeathMatch or 2 for TeamMode"); +} +COMMAND(setbottimeout, ARG_2INT); + bool intermission = false; int arenaintermission = 0; struct serverstate servstate = { 0 }; diff --git a/source/src/server.cpp b/source/src/server.cpp index d84bfcb6..f1a73514 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -55,6 +55,8 @@ vector sents; char *maplayout = NULL, *testlayout = NULL; int maplayout_factor, testlayout_factor, maplayoutssize; servermapbuffer mapbuffer; +int botmatch_dm_minremain = 10; // deathmatch +int botmatch_tm_minremain = 15; // teammode // cmod char *global_name; @@ -1841,7 +1843,7 @@ void resetserver(const char *newname, int newmode, int newtime) smode = newmode; copystring(smapname, newname); - minremain = newtime >= 0 ? newtime : (m_teammode ? 15 : 10); + minremain = newtime >= 0 ? newtime : (m_botmode ? (m_teammode ? botmatch_tm_minremain : botmatch_dm_minremain) : (m_teammode ? 15 : 10)); gamemillis = 0; gamelimit = minremain*60000; arenaround = arenaroundstartmillis = 0;