You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// fail out if the player looks away or moves away.
if ( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST )
{
// player moved away.
TaskFail();
}
UTIL_MakeVectors( pPlayer->v.angles );
if ( UTIL_DotPoints( pPlayer->v.origin, pev->origin, gpGlobals->v_forward ) < m_flFieldOfView )
{
// player looked away
TaskFail();
}
}
if ( gpGlobals->time > m_flWaitFinished )
{
TaskComplete();
}
break;
To fix this the code needs to be changed to this:
case TASK_TLK_CLIENT_STARE:
case TASK_TLK_LOOK_AT_CLIENT:
{
// Get edict for one playeredict_t* pPlayer = g_engfuncs.pfnPEntityOfEntIndex(1);
// track head to the client for a while.if (pPlayer &&
m_MonsterState == MONSTERSTATE_IDLE &&
!IsMoving() &&
!IsTalking())
{
IdleHeadTurn(pPlayer->v.origin);
}
else
{
// started moving or talkingTaskFail();
return;
}
if (pTask->iTask == TASK_TLK_CLIENT_STARE)
{
// fail out if the player looks away or moves away.if ((pPlayer->v.origin - pev->origin).Length2D() > TLK_STARE_DIST)
{
// player moved away.TaskFail();
}
UTIL_MakeVectors(pPlayer->v.angles);
if (UTIL_DotPoints(pPlayer->v.origin, pev->origin, gpGlobals->v_forward) < m_flFieldOfView)
{
// player looked awayTaskFail();
}
}
if (gpGlobals->time > m_flWaitFinished)
{
TaskComplete();
}
break;
}
The text was updated successfully, but these errors were encountered:
CTalkMonster::RunTask does not properly initialize a local variable:
halflife/dlls/talkmonster.cpp
Lines 499 to 545 in c7240b9
To fix this the code needs to be changed to this:
The text was updated successfully, but these errors were encountered: