From f82d24371bf784b2195daeeef62e977cbaaa1176 Mon Sep 17 00:00:00 2001 From: Volch Date: Wed, 13 Sep 2023 15:33:17 +0300 Subject: [PATCH] Fixed segfault caused by attitude check when monster shooting vehicle --- src/mattack_actors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mattack_actors.cpp b/src/mattack_actors.cpp index eda2aa6b6b83..2bf7cccf00e0 100644 --- a/src/mattack_actors.cpp +++ b/src/mattack_actors.cpp @@ -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 );