Fix potential memory overwrite in soccer mode when using one player
only (artist debug mode).
This commit is contained in:
parent
8b7bf28e0f
commit
9dff5a7990
@ -436,6 +436,11 @@ void SoccerWorld::initKartList()
|
||||
for(unsigned int n=0; n<kart_amount; n++)
|
||||
{
|
||||
SoccerTeam team = race_manager->getLocalKartInfo(n).getSoccerTeam();
|
||||
#ifdef DEBUG
|
||||
// In debug mode it's possible to play soccer with a single player
|
||||
// (in artist debug mode). Avoid overwriting memory in this case.
|
||||
if(team==SOCCER_TEAM_NONE) team=SOCCER_TEAM_RED;
|
||||
#endif
|
||||
m_karts[n]->setPosition(team_cur_position[team]);
|
||||
team_cur_position[team]++;
|
||||
} // next kart
|
||||
|
Loading…
x
Reference in New Issue
Block a user