fix: crash bug introduced in latest commit (resolves #630)

fix: unnecessary assignments here and there
This commit is contained in:
jeefo 2024-10-20 17:31:45 +03:00
commit 3d84b96534
No known key found for this signature in database
GPG key ID: D696786B81B667C8
3 changed files with 7 additions and 12 deletions

View file

@ -286,7 +286,6 @@ void Bot::updateLookAnglesNewbie (const Vector &direction, float delta) {
const float offsetDelay = 1.2f;
Vector stiffness {};
Vector randomize {};
m_idealAngles = direction.get2d ();
m_idealAngles.clampAngles ();
@ -303,6 +302,8 @@ void Bot::updateLookAnglesNewbie (const Vector &direction, float delta) {
&& ((pev->velocity.length () > 1.0f
&& m_angularDeviation.length () < 5.0f) || m_angularDeviation.length () < 1.0f)) {
Vector randomize {};
// is the bot standing still ?
if (pev->velocity.length () < 1.0f) {
randomize = randomization * 0.2f; // randomize less