mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 18:38:26 +00:00
Fix replay bots getting stuck, alternative to #336.
This commit is contained in:
parent
9af9cb4758
commit
a8f366bd23
@ -817,7 +817,17 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
|
||||
MakeVectorFromPoints(vecCurrentPosition, vecPosition, vecVelocity);
|
||||
ScaleVector(vecVelocity, gF_Tickrate);
|
||||
|
||||
float fDistance = GetVectorDistance(vecCurrentPosition, vecPosition);
|
||||
|
||||
if((gI_ReplayTick[iReplayBotStyle] % RoundToFloor(gF_Tickrate * 1.5)) == 0 && GetVectorLength(vecVelocity) < 2.0 * fDistance)
|
||||
{
|
||||
TeleportEntity(client, vecPosition, vecAngles, vecVelocity);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
TeleportEntity(client, NULL_VECTOR, vecAngles, vecVelocity);
|
||||
}
|
||||
|
||||
return Plugin_Changed;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user