Restoring previous conditions in setfollowplayer().

Current conditions appeared with commit: https://github.com/assaultcube/AC/commit/8f39911eb0725b22bb4dc3a50d3e89702afcc49c
The problem with its is, that when player is SPECTATOR,  then "/setfollowplayer CN" command works only on players in CLA team, and should work on all, like "changefollowplayer".
This commit fixes that. Thread related to this bug: http://forum.cubers.net/thread-7495.html
This commit is contained in:
aurhat
2014-02-16 13:50:06 +01:00
parent ef165773b8
commit 1bb7a5d7ac
+1 -1
View File
@@ -1687,7 +1687,7 @@ void setfollowplayer(int cn)
// silently ignores invalid player-cn value passed
if(players.inrange(cn) && players[cn])
{
if(!(m_teammode && !watchingdemo && team_base(players[cn]->team) != team_base(player1->team)))
if(!(m_teammode && player1->team != TEAM_SPECT && !watchingdemo && team_base(players[cn]->team) != team_base(player1->team)))
{
player1->followplayercn = cn;
if(player1->spectatemode == SM_FLY) player1->spectatemode = SM_FOLLOW1ST;