Tell the AI to not gift free nitro cans when a switch is active

This commit is contained in:
Alayan 2018-09-22 16:22:52 +02:00
parent c7ea40df6c
commit 63a377cf0b
2 changed files with 3 additions and 1 deletions

View File

@ -135,6 +135,7 @@ public:
void reset ();
virtual void collectedItem (Item *item, AbstractKart *kart);
void switchItems ();
bool areItemSwitched() { return (m_switch_ticks > 0); }
bool randomItemsForArena(const AlignedArray<btTransform>& pos);
// ------------------------------------------------------------------------
/** Only used in the NetworkItemManager. */

View File

@ -1424,7 +1424,8 @@ void SkiddingAI::handleBubblegum(int item_skill, const std::vector<const Item *>
if (abs_angle < 0.2f) straight_behind = true;
}
if(m_distance_behind < 8.0f && straight_behind )
if(m_distance_behind < 8.0f && straight_behind &&
(!ItemManager::get()->areItemSwitched() || item_skill < 4))
{
m_controls->setFire(true);
m_controls->setLookBack(true);