Skip to content

Commit

Permalink
Simplify baby check
Browse files Browse the repository at this point in the history
  • Loading branch information
GuardianDll authored Sep 2, 2024
1 parent 23f4a8c commit c8abb04
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit c8abb04

Please sign in to comment.