Don't allow slipstream if one kart is much higher than the other

(i.e. on a bridge). Previously only the 2d projection was
considered.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7496 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-01-21 05:41:10 +00:00
parent 28565593f3
commit 36782958a2

View File

@ -366,6 +366,12 @@ void SlipStream::update(float dt)
m_target_kart->playingEmergencyAnimation() ||
m_target_kart->isEliminated() ) continue;
float diff = fabsf(m_target_kart->getXYZ().getY()
- m_kart->getXYZ().getY() );
// If the kart is 'on top' of this kart (e.g. up on a bridge),
// don't consider it for slipstreaming.
if(diff>6.0f) continue;
// If the kart we are testing against is too slow, no need to test
// slipstreaming. Note: We compare the speed of the other kart
// against the minimum slipstream speed kart of this kart - not