Fixes some inventory stuff (#18445)

* i'm tired

* Update inventory.dm
This commit is contained in:
SapphicOverload
2023-04-12 14:53:14 -04:00
committed by GitHub
parent a8363135a3
commit f5de2b2549
2 changed files with 23 additions and 22 deletions

View File

@@ -164,13 +164,13 @@
update_inv_wear_suit() update_inv_wear_suit()
else if(I == w_uniform) else if(I == w_uniform)
if(invdrop) if(invdrop)
if(r_store) if(r_store && !can_equip(r_store, SLOT_R_STORE, TRUE))
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop. dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store) if(l_store && !can_equip(l_store, SLOT_L_STORE, TRUE))
dropItemToGround(l_store, TRUE) dropItemToGround(l_store, TRUE)
if(wear_id) if(wear_id && !can_equip(wear_id, SLOT_WEAR_ID, TRUE))
dropItemToGround(wear_id) dropItemToGround(wear_id)
if(belt) if(belt && !can_equip(belt, SLOT_BELT, TRUE))
dropItemToGround(belt) dropItemToGround(belt)
w_uniform = null w_uniform = null
update_suit_sensors() update_suit_sensors()

View File

@@ -1060,6 +1060,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
stop_wagging_tail(H) stop_wagging_tail(H)
return return
//Now checks if the item is already equipped to that slot before instantly returning false because of it being there, so you can now check if an item is able to remain in a slot
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H, bypass_equip_delay_self = FALSE) /datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H, bypass_equip_delay_self = FALSE)
if((slot in no_equip) || (slot in extra_no_equip)) if((slot in no_equip) || (slot in extra_no_equip))
if(!I.species_exception || !is_type_in_list(src, I.species_exception)) if(!I.species_exception || !is_type_in_list(src, I.species_exception))
@@ -1074,7 +1075,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return TRUE return TRUE
return FALSE return FALSE
if(SLOT_WEAR_MASK) if(SLOT_WEAR_MASK)
if(H.wear_mask) if(H.wear_mask && H.wear_mask != I)
return FALSE return FALSE
if(!(I.slot_flags & ITEM_SLOT_MASK)) if(!(I.slot_flags & ITEM_SLOT_MASK))
return FALSE return FALSE
@@ -1082,25 +1083,25 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_NECK) if(SLOT_NECK)
if(H.wear_neck) if(H.wear_neck && H.wear_neck != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_NECK) ) if( !(I.slot_flags & ITEM_SLOT_NECK) )
return FALSE return FALSE
return TRUE return TRUE
if(SLOT_BACK) if(SLOT_BACK)
if(H.back) if(H.back && H.back != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_BACK) ) if( !(I.slot_flags & ITEM_SLOT_BACK) )
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_WEAR_SUIT) if(SLOT_WEAR_SUIT)
if(H.wear_suit) if(H.wear_suit && H.wear_suit != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_OCLOTHING) ) if( !(I.slot_flags & ITEM_SLOT_OCLOTHING) )
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_GLOVES) if(SLOT_GLOVES)
if(H.gloves) if(H.gloves && H.gloves != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_GLOVES) ) if( !(I.slot_flags & ITEM_SLOT_GLOVES) )
return FALSE return FALSE
@@ -1108,7 +1109,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_SHOES) if(SLOT_SHOES)
if(H.shoes) if(H.shoes && H.shoes != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_FEET) ) if( !(I.slot_flags & ITEM_SLOT_FEET) )
return FALSE return FALSE
@@ -1121,7 +1122,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_BELT) if(SLOT_BELT)
if(H.belt) if(H.belt && H.belt != I)
return FALSE return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST) var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST)
@@ -1134,7 +1135,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return return
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_GLASSES) if(SLOT_GLASSES)
if(H.glasses) if(H.glasses && H.glasses != I)
return FALSE return FALSE
if(!(I.slot_flags & ITEM_SLOT_EYES)) if(!(I.slot_flags & ITEM_SLOT_EYES))
return FALSE return FALSE
@@ -1145,7 +1146,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_HEAD) if(SLOT_HEAD)
if(H.head) if(H.head && H.head != I)
return FALSE return FALSE
if(!(I.slot_flags & ITEM_SLOT_HEAD)) if(!(I.slot_flags & ITEM_SLOT_HEAD))
return FALSE return FALSE
@@ -1153,7 +1154,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_EARS) if(SLOT_EARS)
if(H.ears) if(H.ears && H.ears != I)
return FALSE return FALSE
if(!(I.slot_flags & ITEM_SLOT_EARS)) if(!(I.slot_flags & ITEM_SLOT_EARS))
return FALSE return FALSE
@@ -1161,13 +1162,13 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_W_UNIFORM) if(SLOT_W_UNIFORM)
if(H.w_uniform) if(H.w_uniform && H.w_uniform != I)
return FALSE return FALSE
if( !(I.slot_flags & ITEM_SLOT_ICLOTHING) ) if( !(I.slot_flags & ITEM_SLOT_ICLOTHING) )
return FALSE return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self) return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(SLOT_WEAR_ID) if(SLOT_WEAR_ID)
if(H.wear_id) if(H.wear_id && H.wear_id != I)
return FALSE return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST) var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST)
@@ -1181,7 +1182,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(SLOT_L_STORE) if(SLOT_L_STORE)
if(HAS_TRAIT(I, TRAIT_NODROP)) //Pockets aren't visible, so you can't move TRAIT_NODROP items into them. if(HAS_TRAIT(I, TRAIT_NODROP)) //Pockets aren't visible, so you can't move TRAIT_NODROP items into them.
return FALSE return FALSE
if(H.l_store) if(H.l_store && H.l_store != I)
return FALSE return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_L_LEG) var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_L_LEG)
@@ -1197,7 +1198,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(SLOT_R_STORE) if(SLOT_R_STORE)
if(HAS_TRAIT(I, TRAIT_NODROP)) if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE return FALSE
if(H.r_store) if(H.r_store && H.r_store != I)
return FALSE return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_R_LEG) var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_R_LEG)
@@ -1214,7 +1215,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(SLOT_S_STORE) if(SLOT_S_STORE)
if(HAS_TRAIT(I, TRAIT_NODROP)) if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE return FALSE
if(H.s_store) if(H.s_store && H.s_store != I)
return FALSE return FALSE
if(!H.wear_suit) if(!H.wear_suit)
if(!disable_warning) if(!disable_warning)
@@ -1232,7 +1233,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return TRUE return TRUE
return FALSE return FALSE
if(SLOT_HANDCUFFED) if(SLOT_HANDCUFFED)
if(H.handcuffed) if(H.handcuffed && H.handcuffed != I)
return FALSE return FALSE
if(!istype(I, /obj/item/restraints/handcuffs)) if(!istype(I, /obj/item/restraints/handcuffs))
return FALSE return FALSE
@@ -1240,7 +1241,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return TRUE return TRUE
if(SLOT_LEGCUFFED) if(SLOT_LEGCUFFED)
if(H.legcuffed) if(H.legcuffed && H.legcuffed != I)
return FALSE return FALSE
if(!istype(I, /obj/item/restraints/legcuffs)) if(!istype(I, /obj/item/restraints/legcuffs))
return FALSE return FALSE
@@ -1248,7 +1249,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
return FALSE return FALSE
return TRUE return TRUE
if(SLOT_IN_BACKPACK) if(SLOT_IN_BACKPACK)
if(H.back) if(H.back && H.back != I)
if(SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_CAN_INSERT, I, H, TRUE)) if(SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_CAN_INSERT, I, H, TRUE))
return TRUE return TRUE
return FALSE return FALSE