mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-09 20:18:17 +03:00
Fixed a crash in FindCornerNodeForExactPath
This commit is contained in:
parent
e9ffb4b9b5
commit
a6f6cbd9b5
1 changed files with 12 additions and 12 deletions
|
@ -3238,25 +3238,25 @@ PathNode *PathSearch::FindCornerNodeForExactPath
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
PathNode *pPathNode[4096];
|
PathNode *pPathNode[4096];
|
||||||
|
PathNode *pParentNode;
|
||||||
|
size_t i, iDepth, index;
|
||||||
|
|
||||||
if (!PathSearch::FindPath(enemy->origin, pSelf->origin, pSelf, fMaxPath, 0, 0.0, 100))
|
if (!PathSearch::FindPath(enemy->origin, pSelf->origin, pSelf, fMaxPath, 0, 0.0, 100))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
size_t iDepth = 0;
|
for (pParentNode = Node->Parent, i = 0; pParentNode; pParentNode = pParentNode->Parent, i++)
|
||||||
for (PathNode* pParentNode = Node->Parent; pParentNode; pParentNode = pParentNode->Parent, iDepth++)
|
|
||||||
{
|
{
|
||||||
pPathNode[iDepth] = pParentNode;
|
pPathNode[i] = pParentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
iDepth = i;
|
||||||
|
if (!iDepth) {
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node = pPathNode[iDepth -1];
|
Node = pPathNode[iDepth -1];
|
||||||
|
|
||||||
|
for (i = 1; i < iDepth; i += 2)
|
||||||
if (iDepth == 0)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
size_t i;
|
|
||||||
for (i = 0; i < iDepth; i += 2)
|
|
||||||
{
|
{
|
||||||
if (!G_SightTrace(
|
if (!G_SightTrace(
|
||||||
pSelf->EyePosition(),
|
pSelf->EyePosition(),
|
||||||
|
@ -3273,7 +3273,7 @@ PathNode *PathSearch::FindCornerNodeForExactPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t index = i - 1;
|
index = i - 1;
|
||||||
if (index < iDepth)
|
if (index < iDepth)
|
||||||
{
|
{
|
||||||
if (index)
|
if (index)
|
||||||
|
@ -3282,7 +3282,7 @@ PathNode *PathSearch::FindCornerNodeForExactPath
|
||||||
pSelf->EyePosition(),
|
pSelf->EyePosition(),
|
||||||
vec_zero,
|
vec_zero,
|
||||||
vec_zero,
|
vec_zero,
|
||||||
pSelf->EyePosition() - pSelf->origin + pPathNode[i]->m_PathPos,
|
pSelf->EyePosition() - pSelf->origin + pPathNode[index]->m_PathPos,
|
||||||
pSelf,
|
pSelf,
|
||||||
enemy,
|
enemy,
|
||||||
0x2040B19,
|
0x2040B19,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue