setbottimeout for DM/TM botmatches of your choice length of time (1-60 minutes)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6267 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -55,6 +55,8 @@ vector<server_entity> 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;
|
||||
|
||||
Reference in New Issue
Block a user