From 871edd8c5e9075d548c68a715911ad08bc5d75de Mon Sep 17 00:00:00 2001 From: Inglonias <2125926+Inglonias@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:56:20 -0500 Subject: [PATCH 1/2] Make hallucination guns imaginary --- src/npc_attack.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/npc_attack.cpp b/src/npc_attack.cpp index 19cd1bb7a617f..841e1d128f119 100644 --- a/src/npc_attack.cpp +++ b/src/npc_attack.cpp @@ -397,7 +397,13 @@ void npc_attack_gun::use( npc &source, const tripoint &location ) const add_msg_debug( debugmode::debug_filter::DF_NPC, "%s is aiming", source.disp_name() ); source.aim( Target_attributes( source.pos(), location ) ); } else { - source.fire_gun( location ); + if (source.is_hallucination()) { + gun_mode mode = source.get_wielded_item().gun_current_mode(); + source.pretend_fire(&source, mode.qty, *mode); + } + else { + source.fire_gun(location); + } add_msg_debug( debugmode::debug_filter::DF_NPC, "%s fires %s", source.disp_name(), gun.display_name() ); } From e2d64493c8e1245fa849b7b31a3e2fb278261ad0 Mon Sep 17 00:00:00 2001 From: Inglonias <2125926+Inglonias@users.noreply.github.com> Date: Fri, 17 Dec 2021 19:11:39 -0500 Subject: [PATCH 2/2] Astyled npc_attack.cpp --- src/npc_attack.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/npc_attack.cpp b/src/npc_attack.cpp index 841e1d128f119..3c0791da2070a 100644 --- a/src/npc_attack.cpp +++ b/src/npc_attack.cpp @@ -397,12 +397,11 @@ void npc_attack_gun::use( npc &source, const tripoint &location ) const add_msg_debug( debugmode::debug_filter::DF_NPC, "%s is aiming", source.disp_name() ); source.aim( Target_attributes( source.pos(), location ) ); } else { - if (source.is_hallucination()) { + if( source.is_hallucination() ) { gun_mode mode = source.get_wielded_item().gun_current_mode(); - source.pretend_fire(&source, mode.qty, *mode); - } - else { - source.fire_gun(location); + source.pretend_fire( &source, mode.qty, *mode ); + } else { + source.fire_gun( location ); } add_msg_debug( debugmode::debug_filter::DF_NPC, "%s fires %s", source.disp_name(), gun.display_name() );