Fix crashes in arena profiling mode
Notice: you need to merge arena_ai_profiling into here to test
This commit is contained in:
parent
0f9438d824
commit
390f45a9d1
@ -155,9 +155,6 @@ const std::string& SoccerWorld::getIdent() const
|
||||
*/
|
||||
void SoccerWorld::update(float dt)
|
||||
{
|
||||
WorldWithRank::update(dt);
|
||||
WorldWithRank::updateTrack(dt);
|
||||
|
||||
updateBallPosition(dt);
|
||||
if (m_track->hasNavMesh())
|
||||
{
|
||||
@ -165,6 +162,9 @@ void SoccerWorld::update(float dt)
|
||||
updateAIData();
|
||||
}
|
||||
|
||||
WorldWithRank::update(dt);
|
||||
WorldWithRank::updateTrack(dt);
|
||||
|
||||
if (getPhase() == World::GOAL_PHASE)
|
||||
{
|
||||
if (m_goal_timer == 0.0f)
|
||||
@ -589,7 +589,14 @@ void SoccerWorld::setAITeam()
|
||||
for (int i = 0; i < total_player; i++)
|
||||
{
|
||||
SoccerTeam team = race_manager->getKartInfo(i).getSoccerTeam();
|
||||
assert(team != SOCCER_TEAM_NONE);
|
||||
|
||||
// Happen in profiling mode
|
||||
if (team == SOCCER_TEAM_NONE);
|
||||
{
|
||||
race_manager->setKartSoccerTeam(i, SOCCER_TEAM_BLUE);
|
||||
team = SOCCER_TEAM_BLUE;
|
||||
}
|
||||
|
||||
team == SOCCER_TEAM_BLUE ? blue_player++ : red_player++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user