mirror of
https://github.com/ENSL/NS.git
synced 2024-11-09 23:01:34 +00:00
Fix crash on marine victory in combat
* Fixed a bug where bots could crash when marines successfully destroy the alien hive in CO
This commit is contained in:
parent
2b27b90f25
commit
5b83a4c886
1 changed files with 7 additions and 3 deletions
|
@ -5217,7 +5217,7 @@ void AIPlayerSetPrimaryCOMarineTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
|||
|
||||
if (randbool())
|
||||
{
|
||||
Vector RandomVisitPoint = UTIL_GetRandomPointOnNavmeshInDonut(pBot->BotNavInfo.NavProfile, StructureToAttack->v.origin, UTIL_MetresToGoldSrcUnits(20.0f), UTIL_MetresToGoldSrcUnits(40.0f));
|
||||
Vector RandomVisitPoint = UTIL_GetRandomPointOnNavmeshInDonut(pBot->BotNavInfo.NavProfile, UTIL_GetEntityGroundLocation(StructureToAttack), UTIL_MetresToGoldSrcUnits(20.0f), UTIL_MetresToGoldSrcUnits(40.0f));
|
||||
|
||||
if (!vIsZero(RandomVisitPoint))
|
||||
{
|
||||
|
@ -5227,8 +5227,6 @@ void AIPlayerSetPrimaryCOMarineTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
|||
}
|
||||
|
||||
AITASK_SetAttackTask(pBot, Task, StructureToAttack, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AIPlayerSetSecondaryCOMarineTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
||||
|
@ -5582,6 +5580,8 @@ void AIPlayerSetSecondaryCOAlienTask(AvHAIPlayer* pBot, AvHAIPlayerTask* Task)
|
|||
|
||||
const AvHAIHiveDefinition* TheHive = AITAC_GetNearestTeamHive(BotTeam, pBot->Edict->v.origin, true);
|
||||
|
||||
if (!TheHive) { return; }
|
||||
|
||||
if (TheHive->bIsUnderAttack)
|
||||
{
|
||||
int NumAttackers = AITAC_GetNumPlayersOfTeamInArea(EnemyTeam, TheHive->FloorLocation, UTIL_MetresToGoldSrcUnits(15.0f), false, nullptr, AVH_USER3_NONE);
|
||||
|
@ -5934,6 +5934,10 @@ bool ShouldBotThink(AvHAIPlayer* pBot)
|
|||
|
||||
void BotResumePlay(AvHAIPlayer* pBot)
|
||||
{
|
||||
pBot->BotNavInfo.LastNavMeshPosition = g_vecZero;
|
||||
pBot->BotNavInfo.LastNavMeshCheckPosition = g_vecZero;
|
||||
pBot->BotNavInfo.LastOpenLocation = g_vecZero;
|
||||
|
||||
ClearBotMovement(pBot);
|
||||
SetBaseNavProfile(pBot);
|
||||
|
||||
|
|
Loading…
Reference in a new issue