A kart is now considered as slow if he is slower than the current kart.

This commit is contained in:
Guillaume P 2014-04-18 08:49:18 +02:00
parent 3febfecbef
commit 43441cf3cc

View File

@ -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 ||