mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 07:11:38 +00:00
Fixed crash on new map start with bots
This commit is contained in:
parent
b3a1c7a6be
commit
14d3e2c54a
4 changed files with 21 additions and 10 deletions
|
@ -3457,6 +3457,7 @@ void AIPlayerSetWantsAndNeedsCOMarineTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Ta
|
|||
NearestArmouryFilter.DeployableTeam = pBot->Player->GetTeam();
|
||||
NearestArmouryFilter.ReachabilityTeam = pBot->Player->GetTeam();
|
||||
NearestArmouryFilter.ReachabilityFlags = pBot->BotNavInfo.NavProfile.ReachabilityFlag;
|
||||
NearestArmouryFilter.IncludeStatusFlags = STRUCTURE_STATUS_COMPLETED;
|
||||
NearestArmouryFilter.ExcludeStatusFlags = STRUCTURE_STATUS_RECYCLING;
|
||||
NearestArmouryFilter.MaxSearchRadius = SearchRadius;
|
||||
|
||||
|
@ -3515,6 +3516,7 @@ void AIPlayerSetWantsAndNeedsMarineTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task
|
|||
NearestArmouryFilter.DeployableTeam = pBot->Player->GetTeam();
|
||||
NearestArmouryFilter.ReachabilityTeam = pBot->Player->GetTeam();
|
||||
NearestArmouryFilter.ReachabilityFlags = pBot->BotNavInfo.NavProfile.ReachabilityFlag;
|
||||
NearestArmouryFilter.IncludeStatusFlags = STRUCTURE_STATUS_COMPLETED;
|
||||
NearestArmouryFilter.ExcludeStatusFlags = STRUCTURE_STATUS_RECYCLING;
|
||||
NearestArmouryFilter.MaxSearchRadius = (bTaskIsUrgent) ? UTIL_MetresToGoldSrcUnits(20.0f) : UTIL_MetresToGoldSrcUnits(5.0f);
|
||||
|
||||
|
|
|
@ -931,7 +931,7 @@ void AIMGR_ResetRound()
|
|||
|
||||
LastAIPlayerCountUpdate = 0.0f;
|
||||
|
||||
AITAC_ClearMapAIData();
|
||||
AITAC_ClearMapAIData(false);
|
||||
|
||||
UTIL_PopulateDoors();
|
||||
UTIL_PopulateWeldableObstacles();
|
||||
|
@ -1035,7 +1035,7 @@ void AIMGR_NewMap()
|
|||
LastAIPlayerCountUpdate = 0.0f;
|
||||
ALERT(at_console, "AI Manager New Map\n");
|
||||
|
||||
AITAC_ClearMapAIData();
|
||||
AITAC_ClearMapAIData(true);
|
||||
|
||||
if (NavmeshLoaded())
|
||||
{
|
||||
|
|
|
@ -2370,19 +2370,28 @@ void AITAC_ClearStructureNavData()
|
|||
}
|
||||
}
|
||||
|
||||
void AITAC_ClearMapAIData()
|
||||
void AITAC_ClearMapAIData(bool bInitialMapLoad)
|
||||
{
|
||||
UTIL_ClearLocalizations();
|
||||
|
||||
ResourceNodes.clear();
|
||||
|
||||
AITAC_ClearHiveInfo();
|
||||
|
||||
AITAC_ClearStructureNavData();
|
||||
|
||||
while (!bTileCacheUpToDate)
|
||||
// If we're clearing AI data due to a map load, then we just clear the hive data immediately since we've reloaded the nav mesh
|
||||
// If we're clearing AI data due to a round restart, then ensure we properly clear all temp obstacles and connections since we're not reloading the mesh
|
||||
if (!bInitialMapLoad)
|
||||
{
|
||||
UTIL_UpdateTileCache();
|
||||
AITAC_ClearHiveInfo();
|
||||
|
||||
AITAC_ClearStructureNavData();
|
||||
|
||||
while (!bTileCacheUpToDate)
|
||||
{
|
||||
UTIL_UpdateTileCache();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Hives.clear();
|
||||
}
|
||||
|
||||
MarineDroppedItemMap.clear();
|
||||
|
|
|
@ -84,7 +84,7 @@ vector<AvHPlayer*> AITAC_GetAllPlayersOnTeamWithLOS(AvHTeamNumber Team, const Ve
|
|||
bool AITAC_ShouldBotBeCautious(AvHAIPlayer* pBot);
|
||||
|
||||
// Clears out the marine and alien buildable structure maps, resource node and hive lists, and the marine item list
|
||||
void AITAC_ClearMapAIData();
|
||||
void AITAC_ClearMapAIData(bool bInitialMapLoad = false);
|
||||
// Clear out all the hive information
|
||||
void AITAC_ClearHiveInfo();
|
||||
|
||||
|
|
Loading…
Reference in a new issue