mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-30 14:47:57 +03:00
Implemented PathSearch::UpdatePathwaysForBadPlace
This commit is contained in:
parent
bcf3aad1b2
commit
c9c7a4beed
2 changed files with 24 additions and 0 deletions
|
@ -2183,6 +2183,29 @@ void PathSearch::ResetNodes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathSearch::UpdatePathwaysForBadPlace(const Vector& origin, float radius, int dir, int team)
|
||||||
|
{
|
||||||
|
float radiusSqr;
|
||||||
|
int i, j, k;
|
||||||
|
|
||||||
|
radiusSqr = radius * radius;
|
||||||
|
|
||||||
|
for (i = 0; i < nodecount; i++) {
|
||||||
|
PathNode* node = pathnodes[i];
|
||||||
|
|
||||||
|
for (j = node->virtualNumChildren; j > 0; j--) {
|
||||||
|
pathway_t& pathway = node->Child[j - 1];
|
||||||
|
if (PointToSegmentDistanceSquared(origin, pathway.pos1, pathway.pos2) < radiusSqr) {
|
||||||
|
for (k = 0; k < 2; k++) {
|
||||||
|
if ((1 << i) & team) {
|
||||||
|
pathway.numBlockers += dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PathInfo *PathSearch::GeneratePath
|
PathInfo *PathSearch::GeneratePath
|
||||||
(
|
(
|
||||||
PathInfo *path
|
PathInfo *path
|
||||||
|
|
|
@ -288,6 +288,7 @@ public:
|
||||||
static void *AllocPathNode( void );
|
static void *AllocPathNode( void );
|
||||||
static void FreePathNode( void * );
|
static void FreePathNode( void * );
|
||||||
static void ResetNodes( void );
|
static void ResetNodes( void );
|
||||||
|
static void UpdatePathwaysForBadPlace(const Vector& origin, float radius, int dir, int team);
|
||||||
static PathInfo *GeneratePath( PathInfo *path );
|
static PathInfo *GeneratePath( PathInfo *path );
|
||||||
static PathInfo *GeneratePathNear( PathInfo *path );
|
static PathInfo *GeneratePathNear( PathInfo *path );
|
||||||
static PathInfo *GeneratePathAway( PathInfo *path );
|
static PathInfo *GeneratePathAway( PathInfo *path );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue