mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 07:11:38 +00:00
Stuck fixes
* Hopefully fixed issue that caused bots to get stuck in the tubes in Ragnarok
This commit is contained in:
parent
f427a9c052
commit
2b27b90f25
1 changed files with 25 additions and 1 deletions
|
@ -7555,7 +7555,31 @@ void BotFollowPath(AvHAIPlayer* pBot)
|
||||||
|
|
||||||
bot_path_node CurrentNode = pBot->BotNavInfo.CurrentPath[pBot->BotNavInfo.CurrentPathPoint];
|
bot_path_node CurrentNode = pBot->BotNavInfo.CurrentPath[pBot->BotNavInfo.CurrentPathPoint];
|
||||||
|
|
||||||
if (IsPlayerStandingOnPlayer(pBot->Edict) && CurrentNode.flag != SAMPLE_POLYFLAGS_WALLCLIMB && CurrentNode.flag != SAMPLE_POLYFLAGS_LADDER)
|
if (CurrentNode.flag == SAMPLE_POLYFLAGS_LADDER || CurrentNode.flag == SAMPLE_POLYFLAGS_WALLCLIMB)
|
||||||
|
{
|
||||||
|
vector<AvHPlayer*> TeamMates = AIMGR_GetAllPlayersOnTeam(pBot->Player->GetTeam());
|
||||||
|
|
||||||
|
for (auto it = TeamMates.begin(); it != TeamMates.end(); it++)
|
||||||
|
{
|
||||||
|
AvHPlayer* ThisPlayer = (*it);
|
||||||
|
|
||||||
|
if (ThisPlayer == pBot->Player) { continue; }
|
||||||
|
|
||||||
|
if (ThisPlayer->pev->groundentity == pBot->Edict)
|
||||||
|
{
|
||||||
|
// If we have a point we can go back to, and we can reach it, then go for it. Otherwise, keep pushing on and hope the other guy moves
|
||||||
|
if (!vIsZero(pBot->BotNavInfo.LastOpenLocation))
|
||||||
|
{
|
||||||
|
if (UTIL_PointIsReachable(pBot->BotNavInfo.NavProfile, pBot->Edict->v.origin, pBot->BotNavInfo.LastOpenLocation, GetPlayerRadius(pBot->Edict)))
|
||||||
|
{
|
||||||
|
NAV_SetMoveMovementTask(pBot, pBot->BotNavInfo.LastOpenLocation, nullptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (IsPlayerStandingOnPlayer(pBot->Edict))
|
||||||
{
|
{
|
||||||
Vector ForwardDir = UTIL_GetForwardVector2D(pBot->Edict->v.angles);
|
Vector ForwardDir = UTIL_GetForwardVector2D(pBot->Edict->v.angles);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue