From 6151a8fba9a52d9ac58c6bbfc55d7687c913d193 Mon Sep 17 00:00:00 2001 From: Lumipharon Date: Tue, 25 Jun 2024 13:40:52 +1200 Subject: [PATCH 1/3] WIP --- code/game/objects/items/weapons/weapon.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/game/objects/items/weapons/weapon.dm b/code/game/objects/items/weapons/weapon.dm index ef0305a1f8fa4..7d0f4b23cd861 100644 --- a/code/game/objects/items/weapons/weapon.dm +++ b/code/game/objects/items/weapons/weapon.dm @@ -18,3 +18,15 @@ if(target == user && !user.do_self_harm) return return ..() + +/obj/item/weapon/afterattack(atom/target, mob/user, has_proximity, click_parameters) + . = ..() + if((item_flags & WIELDED)) + return + var/obj/item/weapon/gun/offhand_gun = (user.r_hand == src ? user.l_hand : user.r_hand) + if(!istype(offhand_gun)) + return + var/list/modifiers = params2list(click_parameters) + modifiers -= "right" + click_parameters = list2params(modifiers) + offhand_gun.start_fire(null, src, target, null, click_parameters, TRUE) From 370e548c607f00b510e7d6ccb1fc11297f3d6e48 Mon Sep 17 00:00:00 2001 From: Lumipharon Date: Tue, 25 Jun 2024 14:51:03 +1200 Subject: [PATCH 2/3] working --- code/game/objects/items/weapons/weapon.dm | 12 ------------ code/modules/projectiles/gun_system.dm | 8 ++++++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items/weapons/weapon.dm b/code/game/objects/items/weapons/weapon.dm index 7d0f4b23cd861..ef0305a1f8fa4 100644 --- a/code/game/objects/items/weapons/weapon.dm +++ b/code/game/objects/items/weapons/weapon.dm @@ -18,15 +18,3 @@ if(target == user && !user.do_self_harm) return return ..() - -/obj/item/weapon/afterattack(atom/target, mob/user, has_proximity, click_parameters) - . = ..() - if((item_flags & WIELDED)) - return - var/obj/item/weapon/gun/offhand_gun = (user.r_hand == src ? user.l_hand : user.r_hand) - if(!istype(offhand_gun)) - return - var/list/modifiers = params2list(click_parameters) - modifiers -= "right" - click_parameters = list2params(modifiers) - offhand_gun.start_fire(null, src, target, null, click_parameters, TRUE) diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 6a14d69243911..013a25a476ff2 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -720,8 +720,12 @@ 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.Adjacent(object)) + return + bypass_checks = TRUE if(gun_on_cooldown(gun_user)) return if(!bypass_checks) From d3f7271a3f99ad26edb17d51cb7f379615d78237 Mon Sep 17 00:00:00 2001 From: Lumipharon Date: Mon, 1 Jul 2024 10:54:53 +1200 Subject: [PATCH 3/3] fix mounted guns and a message typo --- code/modules/projectiles/gun_system.dm | 2 ++ code/modules/projectiles/mounted.dm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 013a25a476ff2..372c0ae0a00cc 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -723,6 +723,8 @@ 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 diff --git a/code/modules/projectiles/mounted.dm b/code/modules/projectiles/mounted.dm index 483acc160545c..e28f2b4905f0c 100644 --- a/code/modules/projectiles/mounted.dm +++ b/code/modules/projectiles/mounted.dm @@ -277,7 +277,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)