Misc. fixes from prior NPC changes

This commit is contained in:
Blixibon 2021-11-04 12:04:31 -05:00
parent 6d48f52d12
commit 276d9ff24f
3 changed files with 15 additions and 6 deletions

View File

@ -7308,7 +7308,6 @@ bool CAI_BaseNPC::IsActivityFinished( void )
#ifdef MAPBASE
if (GetFakeSequenceGesture() != -1)
{
Msg( "Checking if fake sequence gesture is finished\n" );
return IsLayerFinished( GetFakeSequenceGesture() );
}
#endif
@ -16260,9 +16259,16 @@ bool CAI_BaseNPC::IsCrouchedActivity( Activity activity )
case ACT_COVER_SMG1_LOW:
case ACT_RELOAD_SMG1_LOW:
#ifdef MAPBASE
//case ACT_RELOAD_AR2_LOW:
#if AR2_ACTIVITY_FIX == 1
case ACT_COVER_AR2_LOW:
case ACT_RELOAD_AR2_LOW:
#endif
case ACT_RELOAD_PISTOL_LOW:
case ACT_RELOAD_SHOTGUN_LOW:
#ifdef EXPANDED_HL2_WEAPON_ACTIVITIES
case ACT_RELOAD_REVOLVER_LOW:
case ACT_RELOAD_CROSSBOW_LOW:
#endif
#endif
return true;
}

View File

@ -3374,14 +3374,17 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
}
else if (IsActivityFinished())
{
// Dismount complete. Fix up our position if we have to
// Dismount complete.
GetMotor()->MoveClimbStop();
// Fix up our position if we have to
Vector vecTeleportOrigin;
if (GetMotor()->MoveClimbShouldTeleportToSequenceEnd( vecTeleportOrigin ))
{
GetMotor()->MoveClimbStop();
SetLocalOrigin( vecTeleportOrigin );
TaskComplete();
}
TaskComplete();
}
break;
#else

View File

@ -157,7 +157,7 @@ public:
virtual float NodeDistanceSqr( CAI_Node &node )
{
// Heavier hints are considered closer
if (node.GetHint() && node.GetHint()->GetHintWeight() != 1.0f)
if ( node.GetHint() && node.GetHint()->GetHintWeight() != 1.0f && (node.GetHint()->GetGroup() == NULL_STRING || node.GetHint()->GetGroup() == m_pNPC->GetHintGroup()) )
{
return CNodeFilter::NodeDistanceSqr( node ) * node.GetHint()->GetHintWeightInverse();
}