fix: bot kick menu isn't functional

nav: probably fix for ladder climbing (ref #544 ref #319)
bot: implemented [RSE] Neoptolemus's fix for msec calculation (round vs int cast)
This commit is contained in:
jeefo 2024-03-27 23:21:00 +03:00
commit df9bc66023
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
6 changed files with 52 additions and 23 deletions

View file

@ -226,7 +226,7 @@ void Bot::setAimDirection () {
if (onLadder && m_pathWalk.hasNext ()) {
const auto &nextPath = graph[m_pathWalk.next ()];
if ((nextPath.flags & NodeFlag::Ladder) && m_destOrigin.distanceSq (pev->origin) < cr::sqrf (120.0f) && nextPath.origin.z > m_pathOrigin.z + 30.0f) {
if ((nextPath.flags & NodeFlag::Ladder) && m_destOrigin.distanceSq (pev->origin) < cr::sqrf (128.0f) && nextPath.origin.z > m_pathOrigin.z + 30.0f) {
m_lookAt = nextPath.origin;
}
}
@ -357,8 +357,10 @@ void Bot::changeYaw (float speed) {
}
void Bot::updateBodyAngles () {
constexpr float kValue = 1.0f / 3.0f;
// set the body angles to point the gun correctly
pev->angles.x = -pev->v_angle.x * (1.0f / 3.0f);
pev->angles.x = -pev->v_angle.x * kValue;
pev->angles.y = pev->v_angle.y;
pev->angles.clampAngles ();