Fix switching from spectator to active team in bot modes

Before this fix player could switch from spectate to alive mode,
but he stayed in SPECTATOR team.
Note: 2 mouse clicks are necessary to player's spawn. Second respawnself()
is needed, because spawnplayer() is executed before server will switch
player1 to active team, so he would always spawn in CLA base (in bot
team modes).
This commit is contained in:
aurhat
2014-09-30 10:45:18 +02:00
parent fabfb73c83
commit f9ec71cbab
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -355,7 +355,6 @@ class CBotManager
void LoadBotNamesFile(void);
const char *GetBotName(void);
void LoadBotTeamsFile(void);
const char *GetBotTeam(void);
void CreateSkillData(void);
void InitSkillData(void);
void InitBotItems(void);
@@ -398,6 +397,7 @@ public:
void ViewBot(void);
void CalculateMaxAStarCount(void);
void PickNextTrigger(void);
const char *GetBotTeam(void);
void MakeBotFileName(const char *szFileName, const char *szDir1, const char *szDir2,
char *szOutput);
+5
View File
@@ -726,6 +726,11 @@ void respawnself()
if( m_mp(gamemode) ) addmsg(SV_TRYSPAWN, "r");
else
{
if(team_isspect(player1->team))
{
addmsg(SV_SWITCHTEAM, "ri", m_teammode ? teamatoi(BotManager.GetBotTeam()) : rnd(2));
return;
}
showscores(false);
setscope(false);
setburst(false);