Forgotten controller/* in previous patch. They now also

define a proper slowdown on end controller without stopping
on hills.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6340 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-10-26 06:30:39 +00:00
parent c39cf57971
commit 3e4e4e00f1
3 changed files with 10 additions and 9 deletions

View File

@ -155,7 +155,7 @@ void DefaultAIController::reset()
{
m_time_since_last_shot = 0.0f;
m_start_kart_crash_direction = 0;
m_curve_target_speed = m_kart->getMaxSpeedOnTerrain();
m_curve_target_speed = m_kart->getCurrentMaxSpeed();
m_curve_angle = 0.0;
m_start_delay = -1.0f;
m_crash_time = 0.0f;
@ -685,7 +685,7 @@ void DefaultAIController::handleAcceleration( const float dt)
if(m_kart->hasViewBlockedByPlunger())
{
if(!(m_kart->getSpeed() > m_kart->getMaxSpeedOnTerrain() / 2))
if(!(m_kart->getSpeed() > m_kart->getCurrentMaxSpeed() / 2))
m_controls->m_accel = 0.05f;
else
m_controls->m_accel = 0.0f;
@ -764,7 +764,7 @@ void DefaultAIController::handleNitroAndZipper()
{
m_controls->m_nitro = false;
// If we are already very fast, save nitro.
if(m_kart->getSpeed() > 0.95f*m_kart->getMaxSpeedOnTerrain())
if(m_kart->getSpeed() > 0.95f*m_kart->getCurrentMaxSpeed())
return;
// Don't use nitro when the AI has a plunger in the face!
if(m_kart->hasViewBlockedByPlunger()) return;
@ -1040,5 +1040,5 @@ void DefaultAIController::findCurve()
-m_quad_graph->getAngleToNext(m_track_node,
m_successor_index[m_track_node]) );
m_curve_target_speed = m_kart->getMaxSpeedOnTerrain();
m_curve_target_speed = m_kart->getCurrentMaxSpeed();
} // findCurve

View File

@ -94,6 +94,7 @@ EndController::EndController(Kart *kart, StateManager::ActivePlayer *player)
#ifdef AI_DEBUG
m_debug_sphere = irr_driver->getSceneManager()->addSphereSceneNode(1);
#endif
m_kart->setSlowdown(MaxSpeed::MS_DECREASE_AI, 0.3f, 2);
} // EndController
//-----------------------------------------------------------------------------
@ -143,7 +144,7 @@ void EndController::update(float dt)
m_controls->m_look_back = false;
m_controls->m_nitro = false;
m_controls->m_brake = false;
m_controls->m_accel = 0.3f;
m_controls->m_accel = 1.0f;
// Update the current node:
if(m_track_node!=QuadGraph::UNKNOWN_SECTOR)

View File

@ -571,7 +571,7 @@ void NewAIController::handleAcceleration( const float DELTA )
if(m_kart->hasViewBlockedByPlunger())
{
if(!(m_kart->getSpeed() > m_kart->getMaxSpeedOnTerrain() / 2))
if(!(m_kart->getSpeed() > m_kart->getCurrentMaxSpeed() / 2))
m_controls->m_accel = 0.05f;
else
m_controls->m_accel = 0.0f;
@ -642,7 +642,7 @@ void NewAIController::handleNitroAndZipper()
{
m_controls->m_nitro = false;
// If we are already very fast, save nitro.
if(m_kart->getSpeed() > 0.95f*m_kart->getMaxSpeedOnTerrain())
if(m_kart->getSpeed() > 0.95f*m_kart->getCurrentMaxSpeed())
return;
// Don't use nitro when the AI has a plunger in the face!
if(m_kart->hasViewBlockedByPlunger()) return;
@ -865,7 +865,7 @@ void NewAIController::reset()
{
m_time_since_last_shot = 0.0f;
m_start_kart_crash_direction = 0;
m_curve_target_speed = m_kart->getMaxSpeedOnTerrain();
m_curve_target_speed = m_kart->getCurrentMaxSpeed();
m_curve_angle = 0.0;
m_time_till_start = -1.0f;
m_crash_time = 0.0f;
@ -939,5 +939,5 @@ void NewAIController::findCurve()
-m_quad_graph->getAngleToNext(m_track_node,
m_successor_index[m_track_node]) );
m_curve_target_speed = m_kart->getMaxSpeedOnTerrain();
m_curve_target_speed = m_kart->getCurrentMaxSpeed();
} // findCurve