mirror of
https://github.com/ENSL/NS.git
synced 2025-03-14 14:41:15 +00:00
Fix crash with path finding
This commit is contained in:
parent
72f48fe4ee
commit
7440810699
5 changed files with 11 additions and 15 deletions
|
@ -1238,10 +1238,10 @@ dtStatus dtNavMesh::addTile(unsigned char* data, int dataSize, int flags,
|
|||
|
||||
connectIntLinks(tile);
|
||||
|
||||
for (int i = 0; i < tile->header->offMeshConCount; i++)
|
||||
{
|
||||
baseOffMeshLinks(tile->offMeshCons[i]);
|
||||
}
|
||||
//for (int i = 0; i < tile->header->offMeshConCount; i++)
|
||||
//{
|
||||
// baseOffMeshLinks(tile->offMeshCons[i]);
|
||||
//}
|
||||
|
||||
// Create connections with neighbour tiles.
|
||||
static const int MAX_NEIS = 32;
|
||||
|
|
|
@ -814,6 +814,7 @@ dtStatus dtTileCache::update(const float /*dt*/, dtNavMesh* navmesh,
|
|||
if (con->state == DT_OFFMESH_DIRTY)
|
||||
{
|
||||
navmesh->unconnectOffMeshLink(con);
|
||||
navmesh->baseOffMeshLinks(con);
|
||||
navmesh->GlobalOffMeshLinks(con);
|
||||
con->state = DT_OFFMESH_CLEAN;
|
||||
}
|
||||
|
|
|
@ -3708,9 +3708,11 @@ void PhaseGateMove(AvHAIPlayer* pBot, const Vector StartPoint, const Vector EndP
|
|||
|
||||
bool IsBotOffPath(const AvHAIPlayer* pBot)
|
||||
{
|
||||
|
||||
// Can't be off the path if we don't have one...
|
||||
if (pBot->BotNavInfo.CurrentPath.size() == 0) { return false; }
|
||||
|
||||
|
||||
if (pBot->BotNavInfo.CurrentPathPoint->flag == SAMPLE_POLYFLAGS_LIFT) { return false; }
|
||||
|
||||
// If we're trying to use a phase gate, then we're fine as long as there is a phase gate within reach at the start and end teleport points
|
||||
if (pBot->BotNavInfo.CurrentPathPoint->flag == SAMPLE_POLYFLAGS_TEAM1PHASEGATE || pBot->BotNavInfo.CurrentPathPoint->flag == SAMPLE_POLYFLAGS_TEAM2PHASEGATE)
|
||||
|
@ -3981,8 +3983,8 @@ void MoveToWithoutNav(AvHAIPlayer* pBot, const Vector Destination)
|
|||
bool bumpLeft = !UTIL_QuickHullTrace(pBot->Edict, stTrcLft, endTrcLft, head_hull);
|
||||
bool bumpRight = !UTIL_QuickHullTrace(pBot->Edict, stTrcRt, endTrcRt, head_hull);
|
||||
|
||||
UTIL_DrawLine(INDEXENT(1), stTrcLft, endTrcLft, 255, 0, 0);
|
||||
UTIL_DrawLine(INDEXENT(1), stTrcRt, endTrcRt, 0, 0, 255);
|
||||
//UTIL_DrawLine(INDEXENT(1), stTrcLft, endTrcLft, 255, 0, 0);
|
||||
//UTIL_DrawLine(INDEXENT(1), stTrcRt, endTrcRt, 0, 0, 255);
|
||||
|
||||
pBot->desiredMovementDir = vForward;
|
||||
|
||||
|
|
|
@ -1502,7 +1502,7 @@ void DroneThink(AvHAIPlayer* pBot)
|
|||
BotProgressTask(pBot, &pBot->PrimaryBotTask);
|
||||
}
|
||||
|
||||
AIDEBUG_DrawBotPath(pBot);
|
||||
//AIDEBUG_DrawBotPath(pBot);
|
||||
}
|
||||
|
||||
void TestNavThink(AvHAIPlayer* pBot)
|
||||
|
|
|
@ -841,13 +841,6 @@ void AITAC_RefreshReachabilityForResNode(AvHAIResourceNode* ResNode)
|
|||
else
|
||||
{
|
||||
bool bIsReachableSkulk = UTIL_PointIsReachable(GetBaseNavProfile(SKULK_BASE_NAV_PROFILE), TeamBStart, ResNodeLocation, max_player_use_reach);
|
||||
|
||||
if (!bIsReachableSkulk)
|
||||
{
|
||||
UTIL_DrawLine(INDEXENT(1), INDEXENT(1)->v.origin, ResNodeLocation, 20.0f);
|
||||
UTIL_DrawLine(INDEXENT(1), INDEXENT(1)->v.origin, TeamBStart, 20.0f, 255, 255, 0);
|
||||
}
|
||||
|
||||
bool bIsReachableGorge = UTIL_PointIsReachable(GetBaseNavProfile(GORGE_BASE_NAV_PROFILE), TeamBStart, ResNodeLocation, max_player_use_reach);
|
||||
bool bIsReachableOnos = UTIL_PointIsReachable(GetBaseNavProfile(ONOS_BASE_NAV_PROFILE), TeamBStart, ResNodeLocation, max_player_use_reach);
|
||||
|
||||
|
|
Loading…
Reference in a new issue