View Single Post
Re: Latest YaPB Beta
Old
  (#67)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: Latest YaPB Beta - 04-01-2009

about button using: at reading an source code I have noticed bug in navigate.cpp in this part of a code:
PHP Code:
   // check if we are going through a door...
   
TraceLine (pev->originm_waypointOrigintrueGetEntity (), &tr);

   if (!
FNullEnt (tr.pHit) && FNullEnt (m_liftEntity) && strncmp (STRING (tr.pHit->v.classname), "func_door"9) == 0)
   {
      
// if the door is near enough...
      
if ((GetEntityOrigin (tr.pHit) - pev->origin).GetLengthSquared () < 2500)
      {
         
m_lastCollTime GetWorldTime () + 0.5// don't consider being stuck

         
if (g_randGen.Long (1100) < 50)
            
MDLL_Use (tr.pHitGetEntity ()); // also 'use' the door randomly
      
}

      
// make sure we are always facing the door when going through it
      
m_aimFlags &= ~(AimPos_LastEnemy AimPos_PredictEnemy);

      
edict_t *button FindNearestButton (STRING (tr.pHit->v.classname));

      
// check if we got valid button
      
if (!FNullEnt (button))
      {
         
m_pickupItem button;
         
m_pickupType PickupType_Button;

         
m_navTimeset GetWorldTime ();
      } 
As I have noticed here function FindNearestButton() takes not targetname, but classname, therefore bot tries to use a door instead of the button, which wants to open.
And one more triviality: in function FindNearestButton () it is necessary to rename 'className' on 'targetName'
  
Reply With Quote