Added a work around to avoid STK hanging (or looping _very_ long).

The number of iterations is now clamped, and appropriate values
will be printed out.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5109 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-04-01 01:29:42 +00:00
parent 2da96bb71b
commit 752d81db11

View File

@ -802,6 +802,12 @@ void DefaultAIController::checkCrashes( const int STEPS, const Vec3& pos )
vel_normal/=speed;
int current_node = m_track_node;
if(STEPS<1 || STEPS>1000)
{
printf("Warning, incorrect STEPS=%d. kart_length %f velocity %f\n",
STEPS, m_kart_length, m_kart->getVelocityLC().getZ());
STEPS=1000;
}
for(int i = 1; STEPS > i; ++i)
{
Vec3 step_coord = pos + vel_normal* m_kart_length * float(i);