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

@ -1472,7 +1472,7 @@ bool Game::isBreakableEntity (edict_t *ent, bool initialSeed) const {
const auto limit = cv_breakable_health_limit.as <float> ();
// not shoot-able
if (ent->v.health >= limit) {
if (ent->v.health < 5 || ent->v.health >= limit) {
return false;
}
constexpr auto kFuncBreakable = StringRef::fnv1a32 ("func_breakable");