Fix #766: slipstream bonus still active after rescue.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11888 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -133,6 +133,9 @@ void SlipStream::reset()
|
||||
{
|
||||
m_slipstream_mode = SS_NONE;
|
||||
m_slipstream_time = 0;
|
||||
|
||||
// Reset a potential max speed increase
|
||||
m_kart->increaseMaxSpeed(MaxSpeed::MS_INCREASE_SLIPSTREAM, 0, 0, 0, 0);
|
||||
} // reset
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -488,22 +491,4 @@ void SlipStream::update(float dt)
|
||||
{
|
||||
setIntensity(1.0f, m_target_kart);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
core::vector3df pos = m_kart->getNode()->getPosition();
|
||||
pos.Y = m_kart->getHoT()+0.2f;
|
||||
m_node->setPosition(pos);
|
||||
core::vector3df f = core::vector3df(0, 0, 10) - f;
|
||||
core::vector3df r = f.getHorizontalAngle();
|
||||
m_node->setRotation(r);
|
||||
return;
|
||||
|
||||
const core::quaternion new_rot(m_kart->getNode()->getRotation());
|
||||
const core::quaternion old_rot(m_node->getRotation() );
|
||||
|
||||
core::quaternion interpo;
|
||||
core::vector3df interp;
|
||||
new_rot.toEuler(interp);
|
||||
m_node->setRotation(interp);
|
||||
} // update
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "karts/abstract_kart_animation.hpp"
|
||||
|
||||
#include "graphics/slip_stream.hpp"
|
||||
#include "karts/abstract_kart.hpp"
|
||||
#include "karts/skidding.hpp"
|
||||
#include "modes/world.hpp"
|
||||
@@ -48,6 +49,7 @@ AbstractKartAnimation::AbstractKartAnimation(AbstractKart *kart,
|
||||
kart->setKartAnimation(this);
|
||||
World::getWorld()->getPhysics()->removeKart(m_kart);
|
||||
kart->getSkidding()->reset();
|
||||
kart->getSlipstream()->reset();
|
||||
if(kart->isSquashed())
|
||||
{
|
||||
// A time of 0 reset the squashing
|
||||
|
||||
@@ -87,7 +87,8 @@ void MaxSpeed::increaseMaxSpeed(unsigned int category, float add_speed,
|
||||
float engine_force, float duration,
|
||||
float fade_out_time)
|
||||
{
|
||||
assert(fade_out_time>0.01f);
|
||||
// Allow fade_out_time 0 if add_speed is set to 0.
|
||||
assert(add_speed==0.0f || fade_out_time>0.01f);
|
||||
assert(category>=MS_INCREASE_MIN && category <MS_INCREASE_MAX);
|
||||
m_speed_increase[category].m_max_add_speed = add_speed;
|
||||
m_speed_increase[category].m_duration = duration;
|
||||
|
||||
Reference in New Issue
Block a user