Fixed bug with ladder climbing

This commit is contained in:
RGreenlees 2024-02-13 23:19:10 +00:00 committed by pierow
parent 261caa1c55
commit 754c48327e
2 changed files with 4 additions and 4 deletions

View file

@ -3408,8 +3408,9 @@ void LadderMove(AvHAIPlayer* pBot, const Vector StartPoint, const Vector EndPoin
return;
}
Vector nearestLadderTop = UTIL_GetNearestLadderTopPoint(pEdict);
if (bIsGoingUpLadder && (pBot->CollisionHullTopLocation.z > EndPoint.z))
if (bIsGoingUpLadder && ((pBot->CollisionHullTopLocation.z > EndPoint.z) || (pBot->Edict->v.origin.z > nearestLadderTop.z)))
{
pBot->desiredMovementDir = vForward;
@ -3428,8 +3429,7 @@ void LadderMove(AvHAIPlayer* pBot, const Vector StartPoint, const Vector EndPoin
return;
}
Vector nearestLadderTop = UTIL_GetNearestLadderTopPoint(pEdict);
if (pBot->Edict->v.origin.z < nearestLadderTop.z)
{

View file

@ -623,7 +623,7 @@ void AIMGR_UpdateAIPlayers()
UpdateBotChat(bot);
AIPlayerThink(bot);
DroneThink(bot);
EndBotFrame(bot);