From c8abb04832f4883645bdb37ee2acc09ff8b16602 Mon Sep 17 00:00:00 2001 From: Anton Simakov <67688115+GuardianDll@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:02:19 +0200 Subject: [PATCH] Simplify baby check --- src/monmove.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/monmove.cpp b/src/monmove.cpp index 2f8482b9301b9..455066b56b19b 100644 --- a/src/monmove.cpp +++ b/src/monmove.cpp @@ -416,14 +416,7 @@ void monster::anger_cub_threatened( monster_plan &mon_plan ) } for( monster &tmp : g->all_monsters() ) { - bool is_baby = false; - if( type->baby_monster == tmp.type->id ) { - is_baby = true; - } - if( MonsterGroupManager::IsMonsterInGroup( type->baby_monster_group, tmp.type->id ) ) { - is_baby = true; - } - if( is_baby ) { + if( type->baby_monster == tmp.type->id || MonsterGroupManager::IsMonsterInGroup( type->baby_monster_group, tmp.type ) ) { // baby nearby; is the player too close? mon_plan.dist = tmp.rate_target( *mon_plan.target, mon_plan.dist, mon_plan.smart_planning ); if( mon_plan.dist <= 3 ) {