Fixed crash in AI controller ... again .. fixed the bugfix for the bugfix *sigh*
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7373 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
a1ba3effc4
commit
c7b52a99eb
@ -54,11 +54,12 @@ AIBaseController::AIBaseController(Kart *kart,
|
||||
// best way, potentially depending on race position etc.
|
||||
int r = rand();
|
||||
int indx = (int)(
|
||||
(r / (float)(RAND_MAX)+1.0f) * next.size()
|
||||
r / ((float)(RAND_MAX)+1.0f) * next.size()
|
||||
);
|
||||
// In case of rounding errors
|
||||
if(indx>(int)next.size()) indx--;
|
||||
m_successor_index.push_back(indx);
|
||||
assert(indx <(int)next.size() && indx>=0);
|
||||
m_next_node_index.push_back(next[indx]);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user