Merge pull request #12675 from Ghommie/Ghommie-cit828

Fixing (un)equip penalties from obscured inv slots.
This commit is contained in:
silicons
2020-07-04 00:12:04 -07:00
committed by GitHub
3 changed files with 8 additions and 7 deletions
+4 -4
View File
@@ -207,18 +207,18 @@
cig_position++
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
if(M != user || !istype(M))
return ..()
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
if(!user.wear_mask && !(SLOT_WEAR_MASK in M.check_obscured_slots()))
var/obj/item/clothing/mask/cigarette/W = cig
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
M.equip_to_slot_if_possible(W, SLOT_WEAR_MASK)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
..()
return ..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")