revised setfollowplayer function - shorter, faster, cleaner - thanks for the hint tempest

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6269 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2011-04-17 16:19:53 +00:00
parent 58648e89f8
commit fa4def23cc
+5 -9
View File
@@ -1492,16 +1492,12 @@ playerent *updatefollowplayer(int shiftdirection)
void setfollowplayer(int cn)
{
// silently ignores invalid player-cn value passed
loopv(players) if(players[i])
{
if(player1->team != TEAM_SPECT && !watchingdemo && m_teammode && team_base(players[i]->team) != team_base(player1->team)) continue;
if(players[i]->clientnum == cn)
{
if(player1->followplayercn != players[i]->clientnum) addmsg(SV_SPECTCN, "ri", cn);
player1->followplayercn = cn;
}
}
if(players.inrange(cn))
{
if(player1->followplayercn != players[cn]->clientnum) addmsg(SV_SPECTCN, "ri", cn);
player1->followplayercn = cn;
}
}
// set new spect mode