Bot fixes

* Fixed bots targeting mines to attack
* Fixed crash on enabling bots after previously disabling them
* Fixed bots not handling doors correctly when enabling them after match start
This commit is contained in:
RGreenlees 2024-04-04 15:54:57 +01:00 committed by pierow
parent 349cf7240f
commit 75469430ad
9 changed files with 276 additions and 111 deletions

View File

@ -2286,7 +2286,7 @@ bool AICOMM_BuildInfantryPortal(AvHAIPlayer* pBot, edict_t* CommChair)
bool AICOMM_CheckForNextRecycleAction(AvHAIPlayer* pBot) bool AICOMM_CheckForNextRecycleAction(AvHAIPlayer* pBot)
{ {
DeployableSearchFilter UnreachableFilter; DeployableSearchFilter UnreachableFilter;
UnreachableFilter.DeployableTypes = (SEARCH_ALL_STRUCTURES & ~(STRUCTURE_MARINE_DEPLOYEDMINE)); UnreachableFilter.DeployableTypes = SEARCH_ALL_STRUCTURES;
UnreachableFilter.DeployableTeam = pBot->Player->GetTeam(); UnreachableFilter.DeployableTeam = pBot->Player->GetTeam();
UnreachableFilter.ReachabilityTeam = pBot->Player->GetTeam(); UnreachableFilter.ReachabilityTeam = pBot->Player->GetTeam();
UnreachableFilter.ReachabilityFlags = AI_REACHABILITY_UNREACHABLE; UnreachableFilter.ReachabilityFlags = AI_REACHABILITY_UNREACHABLE;

View File

@ -134,11 +134,11 @@ typedef enum
STRUCTURE_ALIEN_MOVEMENTCHAMBER = 1u << 18, STRUCTURE_ALIEN_MOVEMENTCHAMBER = 1u << 18,
STRUCTURE_ALIEN_OFFENCECHAMBER = 1u << 19, STRUCTURE_ALIEN_OFFENCECHAMBER = 1u << 19,
SEARCH_ALL_MARINE_STRUCTURES = 0x3FFF, SEARCH_ALL_MARINE_STRUCTURES = 0xFFF,
SEARCH_ALL_ALIEN_STRUCTURES = 0xFC000, SEARCH_ALL_ALIEN_STRUCTURES = 0xFC000,
SEARCH_ANY_RES_TOWER = (STRUCTURE_MARINE_RESTOWER | STRUCTURE_ALIEN_RESTOWER), SEARCH_ANY_RES_TOWER = (STRUCTURE_MARINE_RESTOWER | STRUCTURE_ALIEN_RESTOWER),
SEARCH_ALL_STRUCTURES = -1 SEARCH_ALL_STRUCTURES = ((unsigned int)-1 & ~(STRUCTURE_MARINE_DEPLOYEDMINE))
} AvHAIDeployableStructureType; } AvHAIDeployableStructureType;

View File

@ -129,8 +129,6 @@ Vector UTIL_GetEntityGroundLocation(const edict_t* pEntity)
if (GetDeployableObjectTypeFromEdict(pEntity) == STRUCTURE_ALIEN_HIVE) if (GetDeployableObjectTypeFromEdict(pEntity) == STRUCTURE_ALIEN_HIVE)
{ {
return UTIL_GetFloorUnderEntity(pEntity);
const AvHAIHiveDefinition* Hive = AITAC_GetHiveFromEdict(pEntity); const AvHAIHiveDefinition* Hive = AITAC_GetHiveFromEdict(pEntity);
if (Hive) if (Hive)

View File

@ -2338,26 +2338,6 @@ bool HasBotCompletedClimbMove(const AvHAIPlayer* pBot, Vector MoveStart, Vector
if (!vEquals2D(PositionInMove, MoveEnd, 4.0f)) { return false; } if (!vEquals2D(PositionInMove, MoveEnd, 4.0f)) { return false; }
/*if (NextMoveFlag != SAMPLE_POLYFLAGS_DISABLED)
{
Vector ThisMoveDir = UTIL_GetVectorNormal2D(MoveEnd - MoveStart);
Vector NextMoveDir = UTIL_GetVectorNormal2D(NextMoveDestination - MoveEnd);
float MoveDot = UTIL_GetDotProduct2D(ThisMoveDir, NextMoveDir);
if (MoveDot > 0.0f)
{
if (pBot->Edict->v.origin.z >= RequiredClimbHeight && !pBot->BotNavInfo.IsOnGround)
{
if (UTIL_QuickTrace(pBot->Edict, pBot->Edict->v.origin, NextMoveDestination)
&& fabsf(pBot->CollisionHullBottomLocation.z - MoveEnd.z) < 100.0f)
{
return true;
}
}
}
}*/
if (pBot->BotNavInfo.IsOnGround) if (pBot->BotNavInfo.IsOnGround)
{ {
return UTIL_PointIsDirectlyReachable(pBot->CurrentFloorPosition, NextMoveDestination); return UTIL_PointIsDirectlyReachable(pBot->CurrentFloorPosition, NextMoveDestination);
@ -3352,6 +3332,22 @@ void GroundMove(AvHAIPlayer* pBot, const Vector StartPoint, const Vector EndPoin
Vector CurrentPos = (pBot->BotNavInfo.IsOnGround) ? pBot->Edict->v.origin : pBot->CurrentFloorPosition; Vector CurrentPos = (pBot->BotNavInfo.IsOnGround) ? pBot->Edict->v.origin : pBot->CurrentFloorPosition;
Vector vForward = UTIL_GetVectorNormal2D(EndPoint - CurrentPos); Vector vForward = UTIL_GetVectorNormal2D(EndPoint - CurrentPos);
// If we are over our current path point and can't get to it, try walking towards the next path point if we have one, or just directly forwards
if (vIsZero(vForward))
{
if (pBot->BotNavInfo.CurrentPathPoint < pBot->BotNavInfo.CurrentPath.size() - 1)
{
bot_path_node NextPathNode = pBot->BotNavInfo.CurrentPath[pBot->BotNavInfo.CurrentPathPoint + 1];
vForward = UTIL_GetVectorNormal2D(NextPathNode.Location - CurrentPos);
}
else
{
vForward = UTIL_GetForwardVector2D(pBot->Edict->v.angles);
}
}
// Same goes for the right vector, might not be the same as the bot's right // Same goes for the right vector, might not be the same as the bot's right
Vector vRight = UTIL_GetVectorNormal(UTIL_GetCrossProduct(vForward, UP_VECTOR)); Vector vRight = UTIL_GetVectorNormal(UTIL_GetCrossProduct(vForward, UP_VECTOR));
@ -4369,7 +4365,7 @@ bool IsBotOffFallNode(const AvHAIPlayer* pBot, Vector MoveStart, Vector MoveEnd,
bool IsBotOffClimbNode(const AvHAIPlayer* pBot, Vector MoveStart, Vector MoveEnd, Vector NextMoveDestination, SamplePolyFlags NextMoveFlag) bool IsBotOffClimbNode(const AvHAIPlayer* pBot, Vector MoveStart, Vector MoveEnd, Vector NextMoveDestination, SamplePolyFlags NextMoveFlag)
{ {
if (pBot->BotNavInfo.IsOnGround) if (!IsPlayerClimbingWall(pBot->Edict) && (pBot->Edict->v.flags & FL_ONGROUND))
{ {
return (!UTIL_PointIsDirectlyReachable(GetPlayerBottomOfCollisionHull(pBot->Edict), MoveStart) && !UTIL_PointIsDirectlyReachable(GetPlayerBottomOfCollisionHull(pBot->Edict), MoveEnd)); return (!UTIL_PointIsDirectlyReachable(GetPlayerBottomOfCollisionHull(pBot->Edict), MoveStart) && !UTIL_PointIsDirectlyReachable(GetPlayerBottomOfCollisionHull(pBot->Edict), MoveEnd));
} }
@ -5928,6 +5924,63 @@ void OnosUpdateBotMoveProfile(AvHAIPlayer* pBot, BotMoveStyle MoveStyle)
return; return;
} }
bool NAV_MergeAndUpdatePath(AvHAIPlayer* pBot, std::vector<bot_path_node>& NewPath)
{
if (pBot->BotNavInfo.CurrentPath.size() == 0 || pBot->BotNavInfo.CurrentPathPoint >= pBot->BotNavInfo.CurrentPath.size())
{
pBot->BotNavInfo.CurrentPath.clear();
pBot->BotNavInfo.CurrentPath.insert(pBot->BotNavInfo.CurrentPath.end(), NewPath.begin(), NewPath.end());
pBot->BotNavInfo.CurrentPathPoint = 0;
return true;
}
std::vector<bot_path_node>::iterator OldPathStart = (pBot->BotNavInfo.CurrentPath.begin() + pBot->BotNavInfo.CurrentPathPoint);
std::vector<bot_path_node>::iterator OldPathEnd;
std::vector<bot_path_node>::iterator NewPathStart;
for (OldPathEnd = OldPathStart; OldPathEnd != pBot->BotNavInfo.CurrentPath.end(); OldPathEnd++)
{
if (OldPathEnd->flag != SAMPLE_POLYFLAGS_WALK)
{
break;
}
}
if (OldPathEnd == pBot->BotNavInfo.CurrentPath.end())
{
return false;
}
for (NewPathStart = NewPath.begin(); NewPathStart != NewPath.end(); NewPathStart++)
{
if (NewPathStart->flag != SAMPLE_POLYFLAGS_WALK)
{
break;
}
}
if (NewPathStart == NewPath.end())
{
return false;
}
if (!vEquals(OldPathEnd->FromLocation, NewPathStart->FromLocation, 16.0f) || !vEquals(OldPathEnd->Location, NewPathStart->Location, 16.0f))
{
return false;
}
OldPathEnd = next(OldPathEnd);
NewPathStart = next(NewPathStart);
for (auto it = OldPathEnd; it != pBot->BotNavInfo.CurrentPath.end();)
{
it = pBot->BotNavInfo.CurrentPath.erase(it);
}
pBot->BotNavInfo.CurrentPath.insert(pBot->BotNavInfo.CurrentPath.end(), NewPathStart, NewPath.end());
return true;
}
bool MoveTo(AvHAIPlayer* pBot, const Vector Destination, const BotMoveStyle MoveStyle, const float MaxAcceptableDist) bool MoveTo(AvHAIPlayer* pBot, const Vector Destination, const BotMoveStyle MoveStyle, const float MaxAcceptableDist)
{ {
#ifdef DEBUG #ifdef DEBUG
@ -5964,35 +6017,51 @@ bool MoveTo(AvHAIPlayer* pBot, const Vector Destination, const BotMoveStyle Move
if (bShouldCalculatePath) if (bShouldCalculatePath)
{ {
if (!AbortCurrentMove(pBot, Destination)) { return true; } if (!bIsFlyingProfile && !pBot->BotNavInfo.IsOnGround && !IsPlayerClimbingWall(pBot->Edict))
{
if (!bIsFlyingProfile && !pBot->BotNavInfo.IsOnGround) { return true; } if (pBot->BotNavInfo.CurrentPath.size() > 0)
{
BotFollowPath(pBot);
}
return true;
}
dtStatus PathFindingStatus = DT_FAILURE; dtStatus PathFindingStatus = DT_FAILURE;
if (bEndGoalChanged) vector<bot_path_node> PendingPath;
{
ClearBotPath(pBot);
NAV_ClearMovementTask(pBot);
}
if (bIsFlyingProfile) if (bIsFlyingProfile)
{ {
PathFindingStatus = FindFlightPathToPoint(pBot->BotNavInfo.NavProfile, pBot->Edict->v.origin, Destination, BotNavInfo->CurrentPath, MaxAcceptableDist); PathFindingStatus = FindFlightPathToPoint(pBot->BotNavInfo.NavProfile, pBot->Edict->v.origin, Destination, PendingPath, MaxAcceptableDist);
} }
else else
{ {
Vector NavAdjustedDestination = AdjustPointForPathfinding(Destination); Vector NavAdjustedDestination = AdjustPointForPathfinding(Destination);
if (vIsZero(NavAdjustedDestination)) { return false; } if (vIsZero(NavAdjustedDestination)) { return false; }
PathFindingStatus = FindPathClosestToPoint(pBot, pBot->BotNavInfo.MoveStyle, pBot->CurrentFloorPosition, NavAdjustedDestination, BotNavInfo->CurrentPath, MaxAcceptableDist); PathFindingStatus = FindPathClosestToPoint(pBot, pBot->BotNavInfo.MoveStyle, pBot->CurrentFloorPosition, NavAdjustedDestination, PendingPath, MaxAcceptableDist);
} }
pBot->BotNavInfo.NextForceRecalc = 0.0f; pBot->BotNavInfo.NextForceRecalc = 0.0f;
pBot->BotNavInfo.bNavProfileChanged = false; pBot->BotNavInfo.bNavProfileChanged = false;
if (dtStatusSucceed(PathFindingStatus) && BotNavInfo->CurrentPath.size() > 0) if (dtStatusSucceed(PathFindingStatus))
{ {
if (!NAV_MergeAndUpdatePath(pBot, PendingPath))
{
if (!AbortCurrentMove(pBot, Destination))
{
return true;
}
else
{
ClearBotPath(pBot);
NAV_ClearMovementTask(pBot);
pBot->BotNavInfo.CurrentPath.insert(pBot->BotNavInfo.CurrentPath.begin(), PendingPath.begin(), PendingPath.end());
BotNavInfo->CurrentPathPoint = 0;
}
}
pBot->BotNavInfo.StuckInfo.bPathFollowFailed = false; pBot->BotNavInfo.StuckInfo.bPathFollowFailed = false;
ClearBotStuckMovement(pBot); ClearBotStuckMovement(pBot);
pBot->BotNavInfo.TotalStuckTime = 0.0f; pBot->BotNavInfo.TotalStuckTime = 0.0f;
@ -6004,11 +6073,12 @@ bool MoveTo(AvHAIPlayer* pBot, const Vector Destination, const BotMoveStyle Move
BotNavInfo->TargetDestination = Destination; BotNavInfo->TargetDestination = Destination;
} }
BotNavInfo->CurrentPathPoint = 0;
} }
else else
{ {
if (pBot->BotNavInfo.CurrentPath.size() == 0)
{
pBot->BotNavInfo.StuckInfo.bPathFollowFailed = true; pBot->BotNavInfo.StuckInfo.bPathFollowFailed = true;
if (!UTIL_PointIsOnNavmesh(pBot->CollisionHullBottomLocation, pBot->BotNavInfo.NavProfile) && !vIsZero(BotNavInfo->LastNavMeshPosition)) if (!UTIL_PointIsOnNavmesh(pBot->CollisionHullBottomLocation, pBot->BotNavInfo.NavProfile) && !vIsZero(BotNavInfo->LastNavMeshPosition))
@ -6040,11 +6110,10 @@ bool MoveTo(AvHAIPlayer* pBot, const Vector Destination, const BotMoveStyle Move
return true; return true;
} }
} }
ClearBotPath(pBot);
return false; return false;
} }
} }
}
if (!bIsPerformingMoveTask && BotNavInfo->MovementTask.TaskType != MOVE_TASK_NONE) if (!bIsPerformingMoveTask && BotNavInfo->MovementTask.TaskType != MOVE_TASK_NONE)
{ {

View File

@ -4150,6 +4150,17 @@ void AIPlayerNSAlienThink(AvHAIPlayer* pBot)
pBot->CurrentTask = AIPlayerGetNextTask(pBot); pBot->CurrentTask = AIPlayerGetNextTask(pBot);
if (gpGlobals->time - pBot->LastCombatTime > 5.0f) if (gpGlobals->time - pBot->LastCombatTime > 5.0f)
{
bool bInMiddleOfMove = false;
if (pBot->BotNavInfo.CurrentPath.size() > 0 && pBot->BotNavInfo.CurrentPathPoint < pBot->BotNavInfo.CurrentPath.size())
{
bot_path_node CurrentMove = pBot->BotNavInfo.CurrentPath[pBot->BotNavInfo.CurrentPathPoint];
bInMiddleOfMove = CurrentMove.flag != SAMPLE_POLYFLAGS_WALK;
}
if (!bInMiddleOfMove)
{ {
if (!PlayerHasAlienUpgradeOfType(pBot->Edict, HIVE_TECH_DEFENCE) && AITAC_IsAlienUpgradeAvailableForTeam(pBot->Player->GetTeam(), HIVE_TECH_DEFENCE)) if (!PlayerHasAlienUpgradeOfType(pBot->Edict, HIVE_TECH_DEFENCE) && AITAC_IsAlienUpgradeAvailableForTeam(pBot->Player->GetTeam(), HIVE_TECH_DEFENCE))
{ {
@ -4169,6 +4180,7 @@ void AIPlayerNSAlienThink(AvHAIPlayer* pBot)
return; return;
} }
} }
}
if (pBot->CurrentTask && pBot->CurrentTask->TaskType != TASK_NONE) if (pBot->CurrentTask && pBot->CurrentTask->TaskType != TASK_NONE)
{ {

View File

@ -49,6 +49,8 @@ bool bPlayerSpawned = false;
float CountdownStartedTime = 0.0f; float CountdownStartedTime = 0.0f;
bool bBotsEnabled = false;
string BotNames[MAX_PLAYERS] = { "MrRobot", string BotNames[MAX_PLAYERS] = { "MrRobot",
"Wall-E", "Wall-E",
"BeepBoop", "BeepBoop",
@ -879,7 +881,9 @@ void AIMGR_RemoveBotsInReadyRoom()
void AIMGR_ResetRound() void AIMGR_ResetRound()
{ {
if (!AIMGR_IsBotEnabled()) { return; } // Do nothing if we're not using bots if (!AIMGR_IsBotEnabled()) { return; } // Do nothing if we're not using bots, as the data will be cleared out via AIMGR_OnBotDisabled()
AITAC_ClearMapAIData(false);
// AI Players would be 0 if the round is being reset because a new game is starting. If the round is reset // AI Players would be 0 if the round is being reset because a new game is starting. If the round is reset
// from a console command, or tournament mode readying up etc, then bot logic is unaffected // from a console command, or tournament mode readying up etc, then bot logic is unaffected
@ -891,8 +895,6 @@ void AIMGR_ResetRound()
LastAIPlayerCountUpdate = 0.0f; LastAIPlayerCountUpdate = 0.0f;
AITAC_ClearMapAIData(false);
UTIL_PopulateDoors(); UTIL_PopulateDoors();
UTIL_PopulateWeldableObstacles(); UTIL_PopulateWeldableObstacles();
@ -993,12 +995,16 @@ void AIMGR_ClearBotData()
void AIMGR_NewMap() void AIMGR_NewMap()
{ {
AIMGR_BotPrecache();
if (!AIMGR_IsBotEnabled()) { return; } // Do nothing if we're not using bots. Data will be already cleared if bot is disabled via AIMGR_OnBotDisabled()
if (NavmeshLoaded()) if (NavmeshLoaded())
{ {
UnloadNavigationData(); UnloadNavigationData();
} }
if (!AIMGR_IsBotEnabled()) { return; } // Do nothing if we're not using bots AITAC_ClearMapAIData(true);
bMapDataInitialised = false; bMapDataInitialised = false;
@ -1007,10 +1013,6 @@ void AIMGR_NewMap()
AIStartedTime = gpGlobals->time; AIStartedTime = gpGlobals->time;
LastAIPlayerCountUpdate = 0.0f; LastAIPlayerCountUpdate = 0.0f;
AITAC_ClearMapAIData(true);
AIMGR_BotPrecache();
bHasRoundStarted = false; bHasRoundStarted = false;
bPlayerSpawned = false; bPlayerSpawned = false;
@ -1260,3 +1262,95 @@ void AIMGR_PlayerSpawned()
{ {
bPlayerSpawned = true; bPlayerSpawned = true;
} }
void AIMGR_OnBotEnabled()
{
// First clear any stale data
if (NavmeshLoaded())
{
UnloadNavigationData();
}
AITAC_ClearMapAIData(true);
bBotsEnabled = true;
// Now load new stuff for current map
AIMGR_LoadNavigationData();
bMapDataInitialised = false;
ActiveAIPlayers.clear();
AIStartedTime = gpGlobals->time;
LastAIPlayerCountUpdate = 0.0f;
if (AIMGR_GetNavMeshStatus() != NAVMESH_STATUS_FAILED)
{
UTIL_PopulateDoors();
UTIL_PopulateWeldableObstacles();
bool bTileCacheFullyUpdated = UTIL_UpdateTileCache();
while (!bTileCacheFullyUpdated)
{
bTileCacheFullyUpdated = UTIL_UpdateTileCache();
}
}
// Figure out the current game status
bHasRoundStarted = GetGameRules()->GetGameStarted();
bMapDataInitialised = true;
CountdownStartedTime = (bHasRoundStarted || GetGameRules()->GetCountdownStarted()) ? gpGlobals->time : 0.0f;
}
void AIMGR_OnBotDisabled()
{
// Clear all data out
AITAC_ClearMapAIData(false);
if (NavmeshLoaded())
{
UnloadNavigationData();
}
bBotsEnabled = false;
}
void AIMGR_UpdateAISystem()
{
AIMGR_UpdateAIPlayerCounts();
bool bNewBotsEnabled = (avh_botsenabled.value > 0);
if (bNewBotsEnabled != bBotsEnabled)
{
if (bNewBotsEnabled)
{
AIMGR_OnBotEnabled();
}
else
{
AIMGR_OnBotDisabled();
}
bBotsEnabled = bNewBotsEnabled;
return;
}
if (AIMGR_IsBotEnabled())
{
if (AIMGR_GetNavMeshStatus() == NAVMESH_STATUS_PENDING)
{
AIMGR_LoadNavigationData();
}
AIMGR_UpdateAIMapData();
AIMGR_UpdateAIPlayers();
}
}

View File

@ -113,4 +113,11 @@ void AIMGR_ReceiveCommanderRequest(AvHTeamNumber Team, edict_t* Requestor, const
void AIMGR_ClientConnected(edict_t* NewClient); void AIMGR_ClientConnected(edict_t* NewClient);
void AIMGR_PlayerSpawned(); void AIMGR_PlayerSpawned();
// Called when mp_botsenabled changes from 0 to 1
void AIMGR_OnBotEnabled();
// Called when mp_botsenabled changes from 1 to 0
void AIMGR_OnBotDisabled();
void AIMGR_UpdateAISystem();
#endif #endif

View File

@ -1887,25 +1887,23 @@ void BotProgressEvolveTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
} }
else else
{ {
if (vDist2DSq(pBot->Edict->v.origin, UTIL_GetEntityGroundLocation(Task->TaskTarget)) > sqrf(UTIL_MetresToGoldSrcUnits(10.0f)) || UTIL_GetNavAreaAtLocation(BaseNavProfiles[ONOS_BASE_NAV_PROFILE], pBot->Edict->v.origin) != SAMPLE_POLYAREA_GROUND) if (vDist2DSq(pBot->Edict->v.origin, UTIL_GetEntityGroundLocation(Task->TaskTarget)) > sqrf(UTIL_MetresToGoldSrcUnits(10.0f)) || UTIL_GetNavAreaAtLocation(BaseNavProfiles[STRUCTURE_BASE_NAV_PROFILE], pBot->Edict->v.origin) != SAMPLE_POLYAREA_GROUND)
{ {
MoveTo(pBot, UTIL_GetEntityGroundLocation(Task->TaskTarget), MOVESTYLE_NORMAL); MoveTo(pBot, UTIL_GetEntityGroundLocation(Task->TaskTarget), MOVESTYLE_NORMAL, UTIL_MetresToGoldSrcUnits(10.0f));
return; return;
} }
else else
{ {
Task->TaskLocation = FindClosestNavigablePointToDestination(BaseNavProfiles[ONOS_BASE_NAV_PROFILE], pBot->Edict->v.origin, UTIL_GetEntityGroundLocation(Task->TaskTarget), UTIL_MetresToGoldSrcUnits(10.0f)); Task->TaskLocation = FindClosestNavigablePointToDestination(BaseNavProfiles[STRUCTURE_BASE_NAV_PROFILE], pBot->Edict->v.origin, UTIL_GetEntityGroundLocation(Task->TaskTarget), UTIL_MetresToGoldSrcUnits(10.0f));
if (vIsZero(Task->TaskLocation)) if (vIsZero(Task->TaskLocation))
{ {
Task->TaskLocation = pBot->Edict->v.origin; Task->TaskLocation = pBot->Edict->v.origin;
} }
if (Task->TaskLocation != g_vecZero) Vector FinalEvolveLoc = UTIL_GetRandomPointOnNavmeshInRadius(BaseNavProfiles[STRUCTURE_BASE_NAV_PROFILE], Task->TaskLocation, UTIL_MetresToGoldSrcUnits(5.0f));
{
Vector FinalEvolveLoc = UTIL_GetRandomPointOnNavmeshInRadius(BaseNavProfiles[ONOS_BASE_NAV_PROFILE], Task->TaskLocation, UTIL_MetresToGoldSrcUnits(5.0f));
if (FinalEvolveLoc != g_vecZero) if (!vIsZero(FinalEvolveLoc))
{ {
Task->TaskLocation = FinalEvolveLoc; Task->TaskLocation = FinalEvolveLoc;
return; return;
@ -1914,7 +1912,6 @@ void BotProgressEvolveTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
} }
} }
} }
}
void AlienProgressGetHealthTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task) void AlienProgressGetHealthTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
{ {

View File

@ -3649,19 +3649,7 @@ void AvHGamerules::Think(void)
if(GET_RUN_CODE(4)) if(GET_RUN_CODE(4))
{ {
AIMGR_UpdateAIPlayerCounts(); AIMGR_UpdateAISystem();
if (AIMGR_IsBotEnabled())
{
if (AIMGR_GetNavMeshStatus() == NAVMESH_STATUS_PENDING)
{
AIMGR_LoadNavigationData();
}
AIMGR_UpdateAIMapData();
AIMGR_UpdateAIPlayers();
}
if(!this->GetGameStarted()) if(!this->GetGameStarted())
{ {