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)
|
void SoccerWorld::update(float dt)
|
||||||
{
|
{
|
||||||
WorldWithRank::update(dt);
|
|
||||||
WorldWithRank::updateTrack(dt);
|
|
||||||
|
|
||||||
updateBallPosition(dt);
|
updateBallPosition(dt);
|
||||||
if (m_track->hasNavMesh())
|
if (m_track->hasNavMesh())
|
||||||
{
|
{
|
||||||
@ -165,6 +162,9 @@ void SoccerWorld::update(float dt)
|
|||||||
updateAIData();
|
updateAIData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WorldWithRank::update(dt);
|
||||||
|
WorldWithRank::updateTrack(dt);
|
||||||
|
|
||||||
if (getPhase() == World::GOAL_PHASE)
|
if (getPhase() == World::GOAL_PHASE)
|
||||||
{
|
{
|
||||||
if (m_goal_timer == 0.0f)
|
if (m_goal_timer == 0.0f)
|
||||||
@ -589,7 +589,14 @@ void SoccerWorld::setAITeam()
|
|||||||
for (int i = 0; i < total_player; i++)
|
for (int i = 0; i < total_player; i++)
|
||||||
{
|
{
|
||||||
SoccerTeam team = race_manager->getKartInfo(i).getSoccerTeam();
|
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++;
|
team == SOCCER_TEAM_BLUE ? blue_player++ : red_player++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user