From 3fc5314e2b65895b8fcc066a5223df39afca4165 Mon Sep 17 00:00:00 2001 From: adrix89 Date: Fri, 29 Nov 2013 10:56:17 +0200 Subject: [PATCH 1/3] Quick equip active storage,toolbelt,backpack. --- code/modules/mob/living/carbon/human/inventory.dm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index d6badd8be93..d9a7d1d4499 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -13,8 +13,18 @@ update_inv_l_hand(0) else update_inv_r_hand(0) - else - H << "\red You are unable to equip that." + else if(s_active && s_active.can_be_inserted(I,1)) //if storage active insert there + s_active.handle_item_insertion(I) + else + var/obj/item/weapon/storage/S = H.get_item_by_slot(slot_belt) + if(S && 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(S && 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) From 3cfbd7ecff76fe5cb8d6f55e5dfb0f6b6e1422f0 Mon Sep 17 00:00:00 2001 From: adrix89 Date: Fri, 29 Nov 2013 16:20:17 +0200 Subject: [PATCH 2/3] Added putting in box if you have it in your other hand --- code/modules/mob/living/carbon/human/inventory.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index d9a7d1d4499..b916df2c0be 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -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 << "You are not holding anything to equip." return @@ -15,8 +16,10 @@ 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 - var/obj/item/weapon/storage/S = H.get_item_by_slot(slot_belt) + else if(S && S.can_be_inserted(I,1)) //see if we have box in other hand + S.handle_item_insertion(I) + else + S = H.get_item_by_slot(slot_belt) if(S && S.can_be_inserted(I,1)) //else we put in belt S.handle_item_insertion(I) else From 0a31f2640296ca6734593187599b524c0ff191d1 Mon Sep 17 00:00:00 2001 From: adrix89 Date: Fri, 29 Nov 2013 21:55:45 +0200 Subject: [PATCH 3/3] Fixed bug that tried to put things in items with no storage This should work perfectly now. --- code/modules/mob/living/carbon/human/inventory.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index b916df2c0be..86469725bd0 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -16,15 +16,15 @@ 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(S && S.can_be_inserted(I,1)) //see if we have box in other hand + 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 S = H.get_item_by_slot(slot_belt) - if(S && S.can_be_inserted(I,1)) //else we put in 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(S && S.can_be_inserted(I,1)) + 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."