mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
add source-sdk-2013
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
#include "mathlib/ssemath.h"
|
||||
#include "nav_area.h"
|
||||
|
||||
#ifdef STAGING_ONLY
|
||||
extern int g_DebugPathfindCounter;
|
||||
#endif
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
@@ -110,9 +108,7 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go
|
||||
*closestArea = startArea;
|
||||
}
|
||||
|
||||
#ifdef STAGING_ONLY
|
||||
bool isDebug = ( g_DebugPathfindCounter-- > 0 );
|
||||
#endif
|
||||
|
||||
if (startArea == NULL)
|
||||
return false;
|
||||
@@ -158,12 +154,10 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go
|
||||
// get next area to check
|
||||
CNavArea *area = CNavArea::PopOpenList();
|
||||
|
||||
#ifdef STAGING_ONLY
|
||||
if ( isDebug )
|
||||
{
|
||||
area->DrawFilled( 0, 255, 0, 128, 30.0f );
|
||||
}
|
||||
#endif
|
||||
|
||||
// don't consider blocked areas
|
||||
if ( area->IsBlocked( teamID, ignoreNavBlockers ) )
|
||||
@@ -345,13 +339,7 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go
|
||||
continue;
|
||||
|
||||
float newCostSoFar = costFunc( newArea, area, ladder, elevator, length );
|
||||
|
||||
// NaNs really mess this function up causing tough to track down hangs. If
|
||||
// we get inf back, clamp it down to a really high number.
|
||||
DebuggerBreakOnNaN_StagingOnly( newCostSoFar );
|
||||
if ( IS_NAN( newCostSoFar ) )
|
||||
newCostSoFar = 1e30f;
|
||||
|
||||
|
||||
// check if cost functor says this area is a dead-end
|
||||
if ( newCostSoFar < 0.0f )
|
||||
continue;
|
||||
@@ -364,7 +352,7 @@ bool NavAreaBuildPath( CNavArea *startArea, CNavArea *goalArea, const Vector *go
|
||||
// Make sure that any jump to a new area incurs some pathfinsing
|
||||
// cost, to avoid us spinning our wheels over insignificant cost
|
||||
// benefit, floating point precision bug, or busted cost functor.
|
||||
float minNewCostSoFar = area->GetCostSoFar() * 1.00001f + 0.00001f;
|
||||
float minNewCostSoFar = area->GetCostSoFar() * 1.00001 + 0.00001;
|
||||
newCostSoFar = Max( newCostSoFar, minNewCostSoFar );
|
||||
|
||||
// stop if path length limit reached
|
||||
|
||||
Reference in New Issue
Block a user