From 3edb6282517cb230ee15c1c92802d0d9a62ce677 Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 25 Dec 2008 18:27:36 +0000 Subject: [PATCH] only show skidmarks if the player is turning (i.e. don't show skidmarks when player is going straight) caveat: if you press the skid button, turn sharp, then go straight while still holding the button, skid marks will still appear. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2771 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/skid_marks.cpp | 3 +++ src/karts/kart.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphics/skid_marks.cpp b/src/graphics/skid_marks.cpp index f15578fbb..a460d242a 100644 --- a/src/graphics/skid_marks.cpp +++ b/src/graphics/skid_marks.cpp @@ -110,6 +110,9 @@ void SkidMarks::update(float dt) // ------------------------- if(!m_kart.getControls().m_drift) return; // no skidmarking + // not turning enough, don't draw skidmarks if kart is going straight ahead + if( fabsf(m_kart.getSteerPercent()) < 0.55) return; + // Start new skid marks // -------------------- const btWheelInfo::RaycastInfo &raycast_right = diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 66f767d5b..67b71e983 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -780,7 +780,8 @@ void Kart::updatePhysics (float dt) } if(m_skidding>1.0f) { - if(m_skid_sound->getStatus() != SFXManager::SFX_PLAYING) + if(m_skid_sound->getStatus() != SFXManager::SFX_PLAYING && + fabsf(getSteerPercent()) > 0.55 ) m_skid_sound->play(); } else if(m_skid_sound->getStatus() == SFXManager::SFX_PLAYING)