fix: bot: some static-analyzer warnings fixed

This commit is contained in:
jeefo 2023-06-07 23:31:03 +03:00
commit 64aa02955c
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
3 changed files with 2 additions and 5 deletions

View file

@ -1880,7 +1880,7 @@ void Bot::checkGrenadesThrow () {
}; };
// check if throwing a grenade is a good thing to do... // check if throwing a grenade is a good thing to do...
if (preventibleTasks || isInNarrowPlace () || cv_ignore_enemies.bool_ () || m_isUsingGrenade || m_grenadeRequested || m_isReloading || (isKnifeMode () && !bots.isBombPlanted ()) || (m_grenadeRequested || m_grenadeCheckTime >= game.time ())) { if (preventibleTasks || isInNarrowPlace () || cv_ignore_enemies.bool_ () || m_isUsingGrenade || m_grenadeRequested || m_isReloading || (isKnifeMode () && !bots.isBombPlanted ()) || m_grenadeCheckTime >= game.time ()) {
clearThrowStates (m_states); clearThrowStates (m_states);
return; return;
} }

View file

@ -1836,7 +1836,7 @@ void BotGraph::frame () {
m_learnPosition = m_editor->v.origin; m_learnPosition = m_editor->v.origin;
} }
} }
else if (((m_editor->v.flags & FL_ONGROUND) || m_editor->v.movetype == MOVETYPE_FLY) && m_timeJumpStarted + 0.1f < game.time () && m_endJumpPoint) { else if (((m_editor->v.flags & FL_ONGROUND) || m_editor->v.movetype == MOVETYPE_FLY) && m_timeJumpStarted + 0.1f < game.time ()) {
add (NodeAddFlag::JumpEnd); add (NodeAddFlag::JumpEnd);
m_jumpLearnNode = false; m_jumpLearnNode = false;

View file

@ -886,9 +886,6 @@ void Bot::defuseBomb_ () {
m_isReloading = false; m_isReloading = false;
} }
else { else {
m_moveToGoal = false;
m_checkTerrain = false;
m_moveSpeed = 0.0f; m_moveSpeed = 0.0f;
m_strafeSpeed = 0.0f; m_strafeSpeed = 0.0f;
} }