Skip to content

Commit

Permalink
Check for null
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramza13 committed Jan 5, 2021
1 parent bc2e6cf commit ebedbe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,8 @@ monster_attitude monster::attitude( const Character *u ) const
effective_anger -= 10;
}
}

if( faction == u->get_faction()->mon_faction ) {
auto *u_fac = u->get_faction();
if( u_fac && faction == u_fac->mon_faction ) {
return MATT_FRIEND;
}

Expand Down

0 comments on commit ebedbe1

Please sign in to comment.