Skip to content

Commit

Permalink
Fixed segfault caused by attitude check when monster shooting vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollch committed Sep 13, 2023
1 parent 35421cd commit f82d243
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mattack_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ bool gun_actor::call( monster &z ) const
}

// One last check to make sure we're not firing on a friendly
if( z.attitude_to( *target ) == Creature::A_FRIENDLY ) {
if( target && z.attitude_to( *target ) == Creature::A_FRIENDLY ) {
return false;
}
int dist = rl_dist( z.pos(), aim_at );
Expand Down

0 comments on commit f82d243

Please sign in to comment.