For completeness sake added handling of rubber ball to new ai

controller (in case that it should ever be used ;) ).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9309 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-07-20 22:20:45 +00:00
parent 3551e93b12
commit 56aa44e630

View File

@ -443,6 +443,13 @@ void NewAIController::handleItems( const float DELTA, const int STEPS )
m_controls->m_fire = m_time_since_last_shot > 3.0f &&
m_kart->getPosition()>1;
}
case PowerupManager::POWERUP_RUBBERBALL:
// Perhaps some more sophisticated algorithm might be useful.
// For now: fire if there is a kart ahead (which means that
// this kart is certainly not the first kart)
m_controls->m_fire = m_kart_ahead != NULL;
break;
case PowerupManager::POWERUP_SWATTER: // fallthrough
default:
m_controls->m_fire = true;