From 9a6c589ee590e4b95a96d4ef9d184ee6ead6b7ce Mon Sep 17 00:00:00 2001 From: homexp13 <52973135+homexp13@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:14:35 +0300 Subject: [PATCH] Off-hand shooting (#16165) (#24) Co-authored-by: Lumipharon --- code/modules/projectiles/gun_system.dm | 10 ++++++++-- code/modules/projectiles/mounted.dm | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 06ba5a24061..f08d19be7bd 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -700,8 +700,14 @@ if(modifiers["right"]) modifiers -= "right" params = list2params(modifiers) - active_attachable?.start_fire(source, object, location, control, params, bypass_checks) - return + if(gun_user.get_active_held_item() == src) + active_attachable?.start_fire(source, object, location, control, params, bypass_checks) + return + if(gun_user.get_inactive_held_item() != src) + return + if(gun_user.Adjacent(object)) + return + bypass_checks = TRUE if(gun_on_cooldown(gun_user)) return if(!bypass_checks) diff --git a/code/modules/projectiles/mounted.dm b/code/modules/projectiles/mounted.dm index a20c3c3ab16..2bae8e9ba83 100644 --- a/code/modules/projectiles/mounted.dm +++ b/code/modules/projectiles/mounted.dm @@ -275,7 +275,7 @@ setDir(angle) user.set_interaction(src) playsound(loc, 'sound/items/ratchet.ogg', 25, 1) - operator.visible_message("[operator] rotates the [src].","You rotate the [src].") + operator.visible_message("[operator] rotates the [src].","You rotate [src].") update_pixels(user, TRUE) if(current_scope?.deployed_scope_rezoom)