combat: increase check-wall distance when attacking enemies (ref #620)

This commit is contained in:
jeefo 2025-02-15 21:47:05 +03:00
commit 9fe9e08dfa
No known key found for this signature in database
GPG key ID: D696786B81B667C8
3 changed files with 14 additions and 11 deletions

View file

@ -1547,8 +1547,8 @@ void Bot::attackMovement () {
m_strafeSetTime = strafeUpdateTime ();
}
const bool wallOnRight = checkWallOnRight ();
const bool wallOnLeft = checkWallOnLeft ();
const bool wallOnRight = checkWallOnRight (72.0f);
const bool wallOnLeft = checkWallOnLeft (72.0f);
if (m_dodgeStrafeDir == Dodge::Left) {
if (!wallOnLeft) {
@ -1584,7 +1584,10 @@ void Bot::attackMovement () {
// do not move if inside "corridor"
if (wallOnRight && wallOnLeft) {
m_strafeSpeed = 0.0f;
m_moveSpeed = 0.0f;
m_strafeSetTime = game.time () + 3.0f;
m_dodgeStrafeDir = Dodge::None;
}
// we're setting strafe speed regardless of move angles, so not resetting forward move here cause bots to behave strange