mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
Merge pull request #1929 from adrix89/Equip
Quick equip active storage,toolbelt,backpack.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
var/obj/item/I = H.get_active_hand()
|
||||
var/obj/item/weapon/storage/S = H.get_inactive_hand()
|
||||
if(!I)
|
||||
H << "<span class='notice'>You are not holding anything to equip.</span>"
|
||||
return
|
||||
@@ -13,8 +14,20 @@
|
||||
update_inv_l_hand(0)
|
||||
else
|
||||
update_inv_r_hand(0)
|
||||
else if(s_active && s_active.can_be_inserted(I,1)) //if storage active insert there
|
||||
s_active.handle_item_insertion(I)
|
||||
else if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1)) //see if we have box in other hand
|
||||
S.handle_item_insertion(I)
|
||||
else
|
||||
H << "\red You are unable to equip that."
|
||||
S = H.get_item_by_slot(slot_belt)
|
||||
if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1)) //else we put in belt
|
||||
S.handle_item_insertion(I)
|
||||
else
|
||||
S = H.get_item_by_slot(slot_back) //else we put in backpack
|
||||
if(istype(S, /obj/item/weapon/storage) && S.can_be_inserted(I,1))
|
||||
S.handle_item_insertion(I)
|
||||
else
|
||||
H << "\red You are unable to equip that."
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/I, list/slots, del_on_fail = 1)
|
||||
|
||||
Reference in New Issue
Block a user