View Single Post
Re: POD-bot back into shape.
Old
  (#16)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: POD-bot back into shape. - 23-02-2004

Another interesting fix, in BotDoWaypointNav():
Code:
   // BEGIN UBERL33T CODE OF YO MOMMA: special door handling
   UTIL_TraceLine (pEdict->v.origin, pBot->wpt_origin, ignore_monsters, pEdict, &tr);
   if (strncmp (STRING (tr.pHit->v.classname), "func_door", 9) == 0)
   {
	  pBot->iAimFlags = AIM_DEST; // look at door and only at it (so it opens in the right direction)
	  // if bot hits the door, then it opens, so wait a bit to let it open safely
	  if ((pEdict->v.velocity.Length2D () < 2) && (pBot->f_timeDoorOpen < gpGlobals->time))
	  {
		 bottask_t TempTask = {NULL, NULL, TASK_PAUSE, TASKPRI_PAUSE, -1, gpGlobals->time + 0.5, FALSE};
		 BotPushTask (pBot, &TempTask);
		 pBot->f_timeDoorOpen = gpGlobals->time + 1.0; // retry in 1 sec until door is open
	  }
   }
   // END UBERL33T CODE OF YO MOMMA
Interesting enough for a release perhaps ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."