From 4d0996a18cac20ef76a61dc5dfc0c1954ca7ee4d Mon Sep 17 00:00:00 2001 From: RandomGamer123 <31096837+RandomGamer123@users.noreply.github.com> Date: Fri, 4 Jun 2021 10:32:36 -0400 Subject: [PATCH] Fixes rifle scopes working despite not having the gun in hand (#59403) Gun scopes no longer work unless you are holding them in hand (they persist even if you switch your active hand though, useful for reloading) --- code/modules/projectiles/gun.dm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 36c844f1dee..e2001a43e6a 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -590,7 +590,7 @@ if(azoom) azoom.Remove(user) if(zoomed) - zoom(user, user.dir) + zoom(user, user.dir, FALSE) /obj/item/gun/update_overlays() . = ..() @@ -676,10 +676,15 @@ var/obj/item/gun/gun = null /datum/action/toggle_scope_zoom/Trigger() + . = ..() + if(!.) + return gun.zoom(owner, owner.dir) /datum/action/toggle_scope_zoom/IsAvailable() . = ..() + if(owner.get_active_held_item() != gun) + . = FALSE if(!. && gun) gun.zoom(owner, owner.dir, FALSE)