From 8c129ccde67ac2f38d73d3cae2982819b40236eb Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 24 Nov 2010 21:53:13 +0000 Subject: [PATCH] Fixed quick test for slipstreaming, which would sometimes discard slipstreaming even though the distance was fine. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6714 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/slip_stream.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/slip_stream.cpp b/src/graphics/slip_stream.cpp index ffeb44001..9fb85d305 100644 --- a/src/graphics/slip_stream.cpp +++ b/src/graphics/slip_stream.cpp @@ -385,10 +385,12 @@ void SlipStream::update(float dt) } #endif // Quick test: the kart must be not more than - // slipstream length+kart_length() away from the other kart + // slipstream length+0.5*kart_length()+0.5*target_kart_length + // away from the other kart Vec3 delta = m_kart->getXYZ() - m_target_kart->getXYZ(); float l = m_target_kart->getKartProperties()->getSlipstreamLength() - + m_target_kart->getKartLength()*0.5f; + + 0.5f*( m_target_kart->getKartLength() + +m_kart->getKartLength() ); if(delta.length2_2d() > l*l) { if(UserConfigParams::m_slipstream_debug &&