Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into swarmmod
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandern committed Jun 9, 2014
2 parents 0085f2e + 49274bb commit 9ffccd9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/game/server/lambdawars/unit_navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2031,10 +2031,11 @@ void UnitBaseNavigator::UpdateBlockedStatus( UnitBaseMoveCommand &MoveCommand, c
}

// Detect low velocity situation (which means the unit is not moving from the current position)
float fWishSpeedThreshold = MoveCommand.maxspeed * 0.35f;
float fWishSpeed = m_vLastWishVelocity.Length2DSqr();
float fVelocity2dSqr = GetAbsVelocity().Length2DSqr();

if( unit_blocked_lowvel_check.GetBool() && fWishSpeed > 100.0f && fVelocity2dSqr < 100.0 )
if( unit_blocked_lowvel_check.GetBool() && fWishSpeed > fWishSpeedThreshold && fVelocity2dSqr < fWishSpeedThreshold )
{
if( !m_bLowVelocityDetectionActive )
{
Expand All @@ -2061,7 +2062,7 @@ void UnitBaseNavigator::UpdateBlockedStatus( UnitBaseMoveCommand &MoveCommand, c
m_vBlockedLastPosition = GetAbsOrigin();
#else
// Only perform this check if we have no target or if the target is not moving
if( unit_blocked_longdist_check.GetBool() && fWishSpeed > 100.0f && ( !GetPath()->m_hTarget || GetPath()->m_hTarget->GetAbsVelocity().IsLengthLessThan( 10.0f ) ) )
if( unit_blocked_longdist_check.GetBool() && fWishSpeed > fWishSpeedThreshold && ( !GetPath()->m_hTarget || GetPath()->m_hTarget->GetAbsVelocity().IsLengthLessThan( 10.0f ) ) )
{
if( m_fLastWaypointDistance < 0 )
{
Expand Down
4 changes: 3 additions & 1 deletion src/game/shared/lambdawars/unit_locomotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1652,11 +1652,13 @@ void UnitBaseLocomotion::DoUnstuck()
CNavArea *pArea = TheNavMesh->GetNearestNavArea( mv->origin, true, 10000.0f, false, false );
if( pArea )
{
positioninfo_t info( pArea->GetCenter(), m_vecMins, m_vecMaxs, 0, 1024.0f );
positioninfo_t info( pArea->GetCenter(), m_vecMins, m_vecMaxs, 0, 1024.0f, 0, 0, NULL,
8.0f, 256.0f, MASK_NPCSOLID, true );
UTIL_FindPosition( info );
if( info.m_bSuccess )
{
mv->origin = info.m_vPosition;
mv->origin.z += 16.0f;
bFoundPosition = true;
}
}
Expand Down

0 comments on commit 9ffccd9

Please sign in to comment.