Fixed potential crash in AI controller.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7366 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
35cf3c7eab
commit
3da1080eba
@ -54,7 +54,7 @@ AIBaseController::AIBaseController(Kart *kart,
|
||||
// best way, potentially depending on race position etc.
|
||||
int r = rand();
|
||||
int indx = (int)(
|
||||
(r / (float)(RAND_MAX - 1)) * next.size()
|
||||
(r / (float)(RAND_MAX+1)) * next.size()
|
||||
);
|
||||
|
||||
m_successor_index.push_back(indx);
|
||||
|
Loading…
Reference in New Issue
Block a user