bot: stop shoot breakable task in case enemy exists

manager: fix crash due miss-swap of max and min difficulty levels on bot adding (thx @stalin_alex)
This commit is contained in:
jeefo 2025-12-20 00:44:21 +03:00
commit 113cb5e916
No known key found for this signature in database
GPG key ID: D696786B81B667C8
5 changed files with 123 additions and 20 deletions

View file

@ -1469,9 +1469,10 @@ void Bot::escapeFromBomb_ () {
}
void Bot::shootBreakable_ () {
const bool hasEnemy = !game.isNullEntity (m_enemy);
// breakable destroyed?
if (!game.isBreakableEntity (m_breakableEntity)) {
if (hasEnemy || !game.isBreakableEntity (m_breakableEntity)) {
completeTask ();
return;
}