Don't activate zipper if kart is driving backwards (that feels

imho better game-play-wise than accelerating the kart backwards).
This fixes bug 3114776. Also added some docs to btKart.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6694 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-11-22 09:27:12 +00:00
parent 7d65be553f
commit 9cd0ec2544
2 changed files with 4 additions and 1 deletions

View File

@ -933,7 +933,7 @@ void Kart::handleZipper(const Material *material, bool play_sound)
fade_out_time = m_kart_properties->getZipperFadeOutTime();
}
// Ignore a zipper that's activated while braking
if(m_controls.m_brake) return;
if(m_controls.m_brake || m_speed<0) return;
MaxSpeed::increaseMaxSpeed(MaxSpeed::MS_INCREASE_ZIPPER,
max_speed_increase, duration, fade_out_time);

View File

@ -684,6 +684,9 @@ void btKart::updateFriction(btScalar timeStep)
{
if (wheel==2 || wheel==3)
{
// The zipper velocity is the speed that should be
// reached. So compute the impulse to accelerate the
// kart up to that speed:
m_forwardImpulse[wheel] = 0.5f*(m_zipper_velocity - getRigidBody()->getLinearVelocity().length()) / m_chassisBody->getInvMass();
}
}