From 43441cf3cc299914c24e54b53a4a183ee0036213 Mon Sep 17 00:00:00 2001 From: Guillaume P Date: Fri, 18 Apr 2014 08:49:18 +0200 Subject: [PATCH] A kart is now considered as slow if he is slower than the current kart. --- src/karts/controller/skidding_ai.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/karts/controller/skidding_ai.cpp b/src/karts/controller/skidding_ai.cpp index 179b81f40..9d6e53b0a 100644 --- a/src/karts/controller/skidding_ai.cpp +++ b/src/karts/controller/skidding_ai.cpp @@ -1248,8 +1248,8 @@ void SkiddingAI::handleItems(const float dt) if(m_time_since_last_shot<3.0f) break; // Do not fire if the kart is driving too slow - bool kart_behind_is_slow = (m_kart_behind && m_kart_behind->getSpeed() < 0.5 * m_kart_behind->getCurrentMaxSpeed()); - bool kart_ahead_is_slow = (m_kart_ahead && m_kart_ahead->getSpeed() < 0.5 * m_kart_ahead->getCurrentMaxSpeed()); + bool kart_behind_is_slow = (m_kart_behind && m_kart_behind->getSpeed() < m_kart->getSpeed()); + bool kart_ahead_is_slow = (m_kart_ahead && m_kart_ahead->getSpeed() < m_kart->getSpeed()); // Since cakes can be fired all around, just use a sane distance // with a bit of extra for backwards, as enemy will go towards cake bool fire_backwards = !m_kart_ahead ||