mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 01:53:35 +01:00
Update the in-hand sprite when a gun is reloaded (#21676)
* update user hand on reload * review Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> * use forceMove --------- Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
@@ -78,15 +78,22 @@
|
||||
/obj/item/gun/projectile/proc/can_reload()
|
||||
return !magazine
|
||||
|
||||
/obj/item/gun/projectile/proc/reload(obj/item/ammo_box/magazine/AM, mob/user as mob)
|
||||
user.remove_from_mob(AM)
|
||||
magazine = AM
|
||||
magazine.loc = src
|
||||
playsound(src, magin_sound, 50, 1)
|
||||
chamber_round()
|
||||
AM.update_icon()
|
||||
update_icon()
|
||||
/obj/item/gun/projectile/proc/reload(obj/item/ammo_box/magazine/AM, mob/user)
|
||||
user.remove_from_mob(AM)
|
||||
magazine = AM
|
||||
magazine.forceMove(src)
|
||||
playsound(src, magin_sound, 50, 1)
|
||||
chamber_round()
|
||||
AM.update_icon()
|
||||
update_icon()
|
||||
if(!user)
|
||||
return
|
||||
// Update the hand opposite of the one holding ammo (the current one)
|
||||
if(user.hand)
|
||||
user.update_inv_r_hand()
|
||||
else
|
||||
user.update_inv_l_hand()
|
||||
return
|
||||
|
||||
/obj/item/gun/projectile/attackby(obj/item/A as obj, mob/user as mob, params)
|
||||
if(istype(A, /obj/item/ammo_box/magazine))
|
||||
|
||||
Reference in New Issue
Block a user