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)
This commit is contained in:
RandomGamer123
2021-06-04 10:32:36 -04:00
committed by GitHub
parent d7a63a03df
commit 4d0996a18c
+6 -1
View File
@@ -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)