attempt at changing AI behaviour when has a plunger in the face

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2793 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2008-12-26 21:32:00 +00:00
parent 6bc1fd5311
commit dad1ce5592

View File

@ -449,6 +449,12 @@ void DefaultRobot::handleAcceleration( const float DELTA )
}
}
if(hasViewBlockedByPlunger())
{
m_controls.m_accel = 0.2f;
return;
}
m_controls.m_accel = 1.0f;
} // handleAcceleration
@ -493,6 +499,10 @@ void DefaultRobot::handleRescue(const float DELTA)
void DefaultRobot::handleNitro()
{
m_controls.m_nitro = false;
// don't use nitro when has a plunger in the face!
if(hasViewBlockedByPlunger()) return;
// Don't use nitro if the kart doesn't have any, is not on ground,
if(getEnergy()==0 || !isOnGround() ||
m_nitro_level==NITRO_NONE || hasFinishedRace() ) return;