Fix crash when changing kart from overworld
This commit is contained in:
parent
6d7178aff5
commit
7a0afd9321
@ -149,12 +149,12 @@ void OverWorld::update(float dt)
|
||||
if (m_return_to_garage)
|
||||
{
|
||||
m_return_to_garage = false;
|
||||
delayedSelfDestruct();
|
||||
race_manager->exitRace(false);
|
||||
race_manager->exitRace();
|
||||
KartSelectionScreen* s = OfflineKartSelectionScreen::getInstance();
|
||||
s->setMultiplayer(false);
|
||||
s->setFromOverworld(true);
|
||||
StateManager::get()->resetAndGoToScreen(s);
|
||||
throw AbortWorldUpdateException();
|
||||
}
|
||||
} // update
|
||||
|
||||
|
@ -793,7 +793,14 @@ void World::updateWorld(float dt)
|
||||
getPhase() == IN_GAME_MENU_PHASE )
|
||||
return;
|
||||
|
||||
update(dt);
|
||||
try
|
||||
{
|
||||
update(dt);
|
||||
}
|
||||
catch (AbortWorldUpdateException& e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
assert(m_magic_number == 0xB01D6543);
|
||||
|
@ -47,6 +47,12 @@ namespace irr
|
||||
namespace scene { class ISceneNode; }
|
||||
}
|
||||
|
||||
class AbortWorldUpdateException : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
AbortWorldUpdateException() : std::runtime_error("race abort") { };
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief base class for all game modes
|
||||
* This class is responsible for running the actual race. A world is created
|
||||
|
Loading…
x
Reference in New Issue
Block a user