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->origin, m_waypointOrigin, true, GetEntity (), &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 (1, 100) < 50)
MDLL_Use (tr.pHit, GetEntity ()); // 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'