diff --git a/src/game/server/lambdawars/unit_navigator.cpp b/src/game/server/lambdawars/unit_navigator.cpp index f48864015..ecd0df396 100644 --- a/src/game/server/lambdawars/unit_navigator.cpp +++ b/src/game/server/lambdawars/unit_navigator.cpp @@ -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 ) { @@ -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 ) { diff --git a/src/game/shared/lambdawars/unit_locomotion.cpp b/src/game/shared/lambdawars/unit_locomotion.cpp index ff54b2e40..79a101c2c 100644 --- a/src/game/shared/lambdawars/unit_locomotion.cpp +++ b/src/game/shared/lambdawars/unit_locomotion.cpp @@ -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; } }