diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index d8db3d8dde5..3b5ea849596 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -119,8 +119,9 @@ return -// Used to equip an item to the mob. Mainly to prevent copypasta for collect_not_del. -/datum/outfit/proc/equip_item(mob/living/carbon/human/H, path, slot, var/set_no_remove = FALSE) +// Used to equip an item to the mob. Mainly to prevent copypasta for collect_not_del. +//override_collect temporarily allows equip_or_collect without enabling it for the job. Mostly used to prevent weirdness with hand equips when the player is missing one +/datum/outfit/proc/equip_item(mob/living/carbon/human/H, path, slot, var/set_no_remove = FALSE, var/override_collect = FALSE) var/obj/item/I if(isnum(path)) //Check if parameter is not numeric. Must be a path, list of paths or name of a gear datum @@ -138,7 +139,7 @@ if(set_no_remove) I.autodrobe_no_remove = TRUE - if(collect_not_del) + if(collect_not_del || override_collect) H.equip_or_collect(I, slot) else H.equip_to_slot_or_del(I, slot) @@ -240,10 +241,22 @@ if(suit_store) equip_item(H, suit_store, slot_s_store) + //Hand equips. If person is missing an arm or hand it attempts to put it in the other hand. + //Override_collect should attempt to collect any items that can't be equipped regardless of collect_not_del settings for the outfit. if(l_hand) - equip_item(H, l_hand, slot_l_hand) + var/obj/item/organ/external/O + O = H.organs_by_name[BP_L_HAND] + if(!O || !O.is_usable()) + equip_item(H, l_hand, slot_r_hand, override_collect = TRUE) + else + equip_item(H, l_hand, slot_l_hand, override_collect = TRUE) if(r_hand) - equip_item(H, r_hand, slot_r_hand) + var/obj/item/organ/external/O + O = H.organs_by_name[BP_R_HAND] + if(!O || !O.is_usable()) + equip_item(H, r_hand, slot_l_hand, override_collect = TRUE) + else + equip_item(H, r_hand, slot_r_hand, override_collect = TRUE) if(allow_pda_choice) switch(H.pda_choice) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 0fb7554d806..32b00537d9e 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -442,6 +442,16 @@ var/list/global/slot_flags_enumeration = list( return 0 if(slot_wear_id) return 1 + if(slot_l_hand) + var/obj/item/organ/external/O + O = H.organs_by_name[BP_L_HAND] + if(!O || !O.is_usable() || O.is_malfunctioning()) + return FALSE + if(slot_r_hand) + var/obj/item/organ/external/O + O = H.organs_by_name[BP_R_HAND] + if(!O || !O.is_usable() || O.is_malfunctioning()) + return FALSE if(slot_l_store, slot_r_store) if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 4888e8ff97e..d6da17f363d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1169,6 +1169,8 @@ Note that amputating the affected organ does in fact remove the infection from t return 0 /obj/item/organ/external/is_usable() + if(is_stump()) + return FALSE if(is_dislocated()) return FALSE if(tendon_status() & TENDON_CUT) diff --git a/html/changelogs/doxxmedearly - one_handed_equips.yml b/html/changelogs/doxxmedearly - one_handed_equips.yml new file mode 100644 index 00000000000..a38a10c7792 --- /dev/null +++ b/html/changelogs/doxxmedearly - one_handed_equips.yml @@ -0,0 +1,7 @@ +author: Doxxmedearly + +delete-after: True + +changes: + - bugfix: "Fixed some strange behavior relating to missing arms or hands. For example, unloading handgun magazines drops them to the floor instead of deleting them. Report any other buggy behavior." + - bugfix: "Fixed an issue where spawning with a missing hand would cause job items to be deleted, such as liaison briefcases. Now it tries to put it in your other hand. If it can't, it will spawn in your bag or on the floor."