View Single Post
Re: Suicidal tendencies of the Botmanīs BOT#1o
Old
  (#6)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Suicidal tendencies of the Botmanīs BOT#1o - 02-04-2014

Sorry there's a bug in the code


Try

Code:
BOOL CBot::BotChecFloor( void )
{
   Vector v_src, v_fwd;
   TraceResult tr;

   v_src = pev->origin;
   v_fwd = pev->velocity;

   v_fwd.z = v_fwd.z - 50.0f;

   UTIL_TraceLine( v_src, v_src + v_fwd, dont_ignore_monsters, ENT(pev), &tr);

   // check if the trace hit something...
   if (tr.flFraction < 1.0)
   {
      if (f_wall_down = 1)
         f_wall_down = gpGlobals->time;

      return TRUE;
   }

   return FALSE;
}
Note it should be v_src + v_fwd in UTIL_TraceLine

Ps:You'll need to show me the decision the bot takes after you call this function

Last edited by Cheeseh; 02-04-2014 at 04:16.. Reason: Bug in code spotted!
  
Reply With Quote