Fixed crash in debug mode when command line option -N is used.

This commit is contained in:
hiker 2014-12-19 16:03:24 +11:00
parent c4e5a720f7
commit 99f49fbd42
2 changed files with 3 additions and 1 deletions

View File

@ -2163,7 +2163,7 @@ void Kart::updateEngineSFX()
if(isOnGround())
{
float max_speed = m_max_speed->getCurrentMaxSpeed();
assert(max_speed>0);
// Engine noise is based half in total speed, half in fake gears:
// With a sawtooth graph like /|/|/| we get 3 even spaced gears,
// ignoring the gear settings from stk_config, but providing a

View File

@ -51,6 +51,8 @@ MaxSpeed::MaxSpeed(AbstractKart *kart)
// Initialise m_add_engine_force since it might be queried before
// update() is called.
m_add_engine_force = 0;
// This can be used if command line option -N is used
m_current_max_speed = 0;
} // MaxSpeed
// ----------------------------------------------------------------------------