mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fixes dupe and runtime issues with Rod of Asclepius (#36410)
* Fixes bug with duplicating rod on removal while lying down, as well as implemented a new force_put_in_hand() proc, and cleaned up some code. * Merged force_put_in_hand() with put_in_hand() and cleaned up code.
This commit is contained in:
committed by
yogstation13-bot
parent
00f4d9f791
commit
dcf5d8db77
@@ -170,8 +170,12 @@
|
||||
return FALSE
|
||||
return !held_items[hand_index]
|
||||
|
||||
/mob/proc/put_in_hand(obj/item/I, hand_index)
|
||||
if(can_put_in_hand(I, hand_index))
|
||||
/mob/proc/put_in_hand(obj/item/I, hand_index, forced = FALSE)
|
||||
if(forced || can_put_in_hand(I, hand_index))
|
||||
if(hand_index == null)
|
||||
return FALSE
|
||||
if(get_item_for_held_index(hand_index) != null)
|
||||
dropItemToGround(get_item_for_held_index(hand_index), force = TRUE)
|
||||
I.forceMove(src)
|
||||
held_items[hand_index] = I
|
||||
I.layer = ABOVE_HUD_LAYER
|
||||
@@ -185,7 +189,6 @@
|
||||
return hand_index || TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
//Puts the item into the first available left hand if possible and calls all necessary triggers/updates. returns 1 on success.
|
||||
/mob/proc/put_in_l_hand(obj/item/I)
|
||||
return put_in_hand(I, get_empty_held_index_for_side("l"))
|
||||
|
||||
Reference in New Issue
Block a user