Updates inventory procs to allow silent pickup (#17797)

* adds make_sound parameter to put_in_hands, first step to making items able to be picked up with or without sound

* adds make_sound parameter to put_in_active_hand, second step in allowing items to be picked up with or without sound

* adds make_sound parameter to put_in_hand, third step

* redd moment

* weeeeeeee

* NukeOps nuke code papers spawning are now silent
This commit is contained in:
Redd
2023-02-06 19:03:29 -05:00
committed by GitHub
parent 57283fa900
commit 1aac303800
2 changed files with 8 additions and 8 deletions

View File

@@ -215,7 +215,7 @@
if(!istype(H))
P.forceMove(get_turf(H))
else
H.put_in_hands(P, TRUE)
H.put_in_hands(P, TRUE, no_sound = TRUE)
H.update_icons()
/datum/antagonist/nukeop/leader/give_alias()

View File

@@ -175,7 +175,7 @@
return FALSE
return !held_items[hand_index]
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE, ignore_anim = TRUE)
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE, ignore_anim = TRUE, no_sound = FALSE)
if(forced || can_put_in_hand(I, hand_index))
if(isturf(I.loc) && !ignore_anim)
I.do_pickup_animation(src)
@@ -187,7 +187,7 @@
held_items[hand_index] = I
I.layer = ABOVE_HUD_LAYER
I.plane = ABOVE_HUD_PLANE
I.equipped(src, SLOT_HANDS)
I.equipped(src, SLOT_HANDS, no_sound)
if(I.pulledby)
I.pulledby.stop_pulling()
update_inv_hands()
@@ -214,8 +214,8 @@
return FALSE
//Puts the item into our active hand if possible. returns TRUE on success.
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE)
return put_in_hand(I, active_hand_index, forced, ignore_animation)
/mob/proc/put_in_active_hand(obj/item/I, forced = FALSE, ignore_animation = TRUE, no_sound = FALSE)
return put_in_hand(I, active_hand_index, forced, ignore_animation, no_sound)
//Puts the item into our inactive hand if possible, returns TRUE on success
@@ -226,7 +226,7 @@
//Puts the item our active hand if possible. Failing that it tries other hands. Returns TRUE on success.
//If both fail it drops it on the floor and returns FALSE.
//This is probably the main one you need to know :)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE)
/mob/proc/put_in_hands(obj/item/I, del_on_fail = FALSE, merge_stacks = TRUE, forced = FALSE, no_sound = FALSE)
if(!I)
return FALSE
@@ -250,14 +250,14 @@
to_chat(usr, span_notice("Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s."))
return TRUE
if(put_in_active_hand(I, forced))
if(put_in_active_hand(I, forced, no_sound = no_sound))
return TRUE
var/hand = get_empty_held_index_for_side("l")
if(!hand)
hand = get_empty_held_index_for_side("r")
if(hand)
if(put_in_hand(I, hand, forced))
if(put_in_hand(I, hand, forced, no_sound = no_sound))
return TRUE
if(del_on_fail)
qdel(I)