diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 411a460ac62..3e41bf81271 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -387,10 +387,6 @@ toggle_gunlight() visible_message("[src]'s light fades and turns off.") -/obj/item/gun/pickup(mob/user) - . = ..() - if(azoom) - azoom.Grant(user) /obj/item/gun/dropped(mob/user) ..() @@ -522,3 +518,27 @@ if(zoomable) azoom = new() azoom.gun = src + RegisterSignal(src, COMSIG_ITEM_EQUIPPED, .proc/ZoomGrantCheck) + +/** + * Proc which will be called when the gun receives the `COMSIG_ITEM_EQUIPPED` signal. + * + * This happens if the mob picks up the gun, or equips it to any of their slots. + * If the slot is anything other than either of their hands (such as the back slot), un-zoom them, and `Remove` the zoom action button from the mob. + * Otherwise, `Grant` the mob the zoom action button. + * + * Arguments: + * * source - the gun that got equipped, which is `src`. + * * user - the mob equipping the gun. + * * slot - the slot the gun is getting equipped to. + */ +/obj/item/gun/proc/ZoomGrantCheck(datum/source, mob/user, slot) + // Checks if the gun got equipped into either of the user's hands. + if(slot != slot_r_hand && slot != slot_l_hand) + // If its not in their hands, un-zoom, and remove the zoom action button. + zoom(user, FALSE) + azoom.Remove(user) + return FALSE + + // The gun is equipped in their hands, give them the zoom ability. + azoom.Grant(user) diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index e64aced32f9..48aaff9d8b4 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -312,6 +312,8 @@ icon_state = "esniper" origin_tech = "combat=6;materials=5;powerstorage=4" ammo_type = list(/obj/item/ammo_casing/energy/sniper) + item_state = null + weapon_weight = WEAPON_HEAVY slot_flags = SLOT_BACK w_class = WEIGHT_CLASS_BULKY zoomable = TRUE diff --git a/icons/mob/inhands/guns_lefthand.dmi b/icons/mob/inhands/guns_lefthand.dmi index a0a6b7b3f39..940731f6e73 100644 Binary files a/icons/mob/inhands/guns_lefthand.dmi and b/icons/mob/inhands/guns_lefthand.dmi differ diff --git a/icons/mob/inhands/guns_righthand.dmi b/icons/mob/inhands/guns_righthand.dmi index 545318bbed5..3ad61ad5794 100644 Binary files a/icons/mob/inhands/guns_righthand.dmi and b/icons/mob/inhands/guns_righthand.dmi differ