Don't remove a level 2 skid bonus when getting a level 1 (#3410)
This commit is contained in:
parent
80555f4905
commit
8249266338
@ -323,6 +323,14 @@ void MaxSpeed::update(int ticks)
|
|||||||
m_current_max_speed += speedup.getSpeedIncrease();
|
m_current_max_speed += speedup.getSpeedIncrease();
|
||||||
m_add_engine_force += speedup.getEngineForce();
|
m_add_engine_force += speedup.getEngineForce();
|
||||||
}
|
}
|
||||||
|
if (getSpeedIncreaseTicksLeft(MS_INCREASE_SKIDDING) > 0 &&
|
||||||
|
getSpeedIncreaseTicksLeft(MS_INCREASE_RED_SKIDDING) > 0)
|
||||||
|
{
|
||||||
|
SpeedIncrease &speedup = m_speed_increase[MS_INCREASE_SKIDDING];
|
||||||
|
m_current_max_speed -= speedup.getSpeedIncrease();
|
||||||
|
m_add_engine_force -= speedup.getEngineForce();
|
||||||
|
}
|
||||||
|
|
||||||
m_current_max_speed *= slowdown_factor;
|
m_current_max_speed *= slowdown_factor;
|
||||||
|
|
||||||
// Then cap the current speed of the kart
|
// Then cap the current speed of the kart
|
||||||
|
@ -37,6 +37,7 @@ public:
|
|||||||
MS_INCREASE_NITRO,
|
MS_INCREASE_NITRO,
|
||||||
MS_INCREASE_RUBBER,
|
MS_INCREASE_RUBBER,
|
||||||
MS_INCREASE_SKIDDING,
|
MS_INCREASE_SKIDDING,
|
||||||
|
MS_INCREASE_RED_SKIDDING,
|
||||||
MS_INCREASE_MAX};
|
MS_INCREASE_MAX};
|
||||||
|
|
||||||
/** The categories to use for decreasing the speed of a kart:
|
/** The categories to use for decreasing the speed of a kart:
|
||||||
|
@ -503,8 +503,10 @@ void Skidding::update(int ticks, bool is_on_ground,
|
|||||||
->setCreationRateRelative(KartGFX::KGFX_SKIDL, 1.0f);
|
->setCreationRateRelative(KartGFX::KGFX_SKIDL, 1.0f);
|
||||||
m_kart->getKartGFX()
|
m_kart->getKartGFX()
|
||||||
->setCreationRateRelative(KartGFX::KGFX_SKIDR, 1.0f);
|
->setCreationRateRelative(KartGFX::KGFX_SKIDR, 1.0f);
|
||||||
|
unsigned int bonus_cat = (level == 1) ? MaxSpeed::MS_INCREASE_SKIDDING :
|
||||||
|
MaxSpeed::MS_INCREASE_RED_SKIDDING;
|
||||||
m_kart->m_max_speed->
|
m_kart->m_max_speed->
|
||||||
instantSpeedIncrease(MaxSpeed::MS_INCREASE_SKIDDING,
|
instantSpeedIncrease(bonus_cat,
|
||||||
bonus_speed, bonus_speed,
|
bonus_speed, bonus_speed,
|
||||||
bonus_force,
|
bonus_force,
|
||||||
stk_config->time2Ticks(bonus_time),
|
stk_config->time2Ticks(bonus_time),
|
||||||
|
Loading…
Reference in New Issue
Block a user