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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user