spect, invalid index access
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2160 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -857,7 +857,8 @@ playerent *findfollowplayer(int shiftdirection)
|
||||
loopv(players) if(players[i]) available.add(players[i]);
|
||||
if(!available.length()) return NULL;
|
||||
|
||||
int oldidx = available.find(players[player1->followplayercn]);
|
||||
int oldidx = -1;
|
||||
if(players.inrange(player1->followplayercn)) oldidx = available.find(players[player1->followplayercn]);
|
||||
if(oldidx<0) oldidx = 0;
|
||||
int idx = (oldidx+shiftdirection) % available.length();
|
||||
if(idx<0) idx += available.length();
|
||||
|
||||
Reference in New Issue
Block a user