diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6c520ae189f..ccef76c0f14 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -63,6 +63,15 @@ /obj/item/device icon = 'icons/obj/device.dmi' +//Checks if the item is being held by a mob, and if so, updates the held icons +/obj/item/proc/update_held_icon() + if(ismob(src.loc)) + var/mob/M = src.loc + if(M.l_hand == src) + M.update_inv_l_hand() + if(M.r_hand == src) + M.update_inv_r_hand() + /obj/item/ex_act(severity) switch(severity) if(1.0) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 653d7c6b165..ce85604752e 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -138,10 +138,7 @@ handle_post_fire(user, target, pointblank, reflex) update_icon() - if(user.hand) - user.update_inv_l_hand() - else - user.update_inv_r_hand() + update_held_icon() //obtains the next projectile to fire diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index e2b97672c7f..be2995128b0 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -29,10 +29,7 @@ projectile_type = /obj/item/projectile/beam/stun modifystate = "energystun" update_icon() - if(user.l_hand == src) - user.update_inv_l_hand() - else - user.update_inv_r_hand() + update_held_icon() /obj/item/weapon/gun/energy/gun/mounted self_recharge = 1 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 56c5867010c..0b25c82af12 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -60,12 +60,7 @@ projectile_type = /obj/item/projectile/energy/floramut modifystate = "floramut" update_icon() - - item_state = modifystate - if(user.l_hand == src) - user.update_inv_l_hand() - else - user.update_inv_r_hand() + update_held_icon() /obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag) //allow shooting into adjacent hydrotrays regardless of intent diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index c58f9a3da0e..75bbf810a80 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -51,7 +51,7 @@ name = "\improper STS-35 automatic rifle" desc = "A durable, rugged looking automatic weapon of a make popular on the frontier worlds. Uses 7.62mm rounds. It is unmarked." icon_state = "arifle" - item_state = "arifle" + item_state = null w_class = 4 force = 10 caliber = "a762" @@ -63,6 +63,7 @@ /obj/item/weapon/gun/projectile/automatic/sts35/update_icon() ..() icon_state = (ammo_magazine)? "arifle-0" : "arifle" + update_held_icon() /obj/item/weapon/gun/projectile/automatic/wt550 name = "\improper W-T 550 Saber" diff --git a/icons/mob/items/lefthand_guns.dmi b/icons/mob/items/lefthand_guns.dmi index e7024519a02..d564d9bafe3 100644 Binary files a/icons/mob/items/lefthand_guns.dmi and b/icons/mob/items/lefthand_guns.dmi differ diff --git a/icons/mob/items/righthand_guns.dmi b/icons/mob/items/righthand_guns.dmi index be844f4711c..63c5c0ae01b 100644 Binary files a/icons/mob/items/righthand_guns.dmi and b/icons/mob/items/righthand_guns.dmi differ