Fixed bug 3074299 (slipstream in air on low level AI).

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6143 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-09-25 13:48:41 +00:00
parent e261294e47
commit 0c5c9496cf
2 changed files with 8 additions and 3 deletions

View File

@ -49,10 +49,10 @@ SlipStream::SlipStream(Kart* kart) : MovingTexture(0, 0), m_kart(kart)
std::string debug_name = m_kart->getIdent()+" (slip-stream)";
m_node->setName(debug_name.c_str());
#endif
//m_node->setParent(m_kart->getNode());
m_node->setPosition(core::vector3df(0,
0*0.25f+2.5,
m_kart->getKartLength()) );
m_node->setVisible(false);
setTextureMatrix(&(m_node->getMaterial(0).getTextureMatrix(0)));
} // SlipStream
@ -173,6 +173,7 @@ void SlipStream::setIntensity(float f, const Kart *kart)
return;
}
m_node->setVisible(true);
const float above_terrain = 0.2f;
core::vector3df my_pos = m_kart->getNode()->getPosition();
my_pos.Y = m_kart->getHoT()+above_terrain;

View File

@ -880,9 +880,15 @@ float Kart::handleNitro(float dt)
*/
float Kart::handleSlipstream(float dt)
{
// Update this karts slipstream quad (even for low level AI, since even
// then player karts can get slipstream, and so have to compare with
// the modified slipstream quad.
m_slipstream_original_quad->transform(getTrans(), m_slipstream_quad);
// Low level AIs should not do any slipstreaming.
if(!getController()->isPlayerController() &&
race_manager->getDifficulty()==RaceManager::RD_EASY) return 0;
// First see if we are currently using accumulated slipstream credits:
// -------------------------------------------------------------------
if(m_slipstream_mode==SS_USE)
@ -908,8 +914,6 @@ float Kart::handleSlipstream(float dt)
#endif
// Then test if this kart is in the slipstream range of another kart:
// ------------------------------------------------------------------
m_slipstream_original_quad->transform(getTrans(), m_slipstream_quad);
World *world = World::getWorld();
unsigned int num_karts = world->getNumKarts();
bool is_sstreaming = false;