diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 559dac3abbf..9ebbb29ac02 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -110,7 +110,7 @@ if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP. return 1 - if((I.flags & NODROP) && !force) + if(!canUnEquip(I, force)) return 0 if(I == r_hand) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f30ff8ed0f2..3c18cddb18f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -569,6 +569,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, return 1 return + /mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..() . = ..() //Sets the default return value to what the parent returns. if(!. || !I) //We don't want to set anything to null if the parent returned 0. @@ -1041,4 +1042,4 @@ so that different stomachs can handle things in different ways VB*/ /mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0) if(hud_used && hud_used.internals) - hud_used.internals.icon_state = "internal[internal_state]" \ No newline at end of file + hud_used.internals.icon_state = "internal[internal_state]" diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 5e0a4335b83..e0ea6331b69 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -105,15 +105,19 @@ if(slot_tie) return 1 +// The actual dropping happens at the mob level - checks to prevent drops should +// come here +/mob/living/carbon/human/canUnEquip(obj/item/I, force) + . = ..() + var/obj/item/organ/O = I + if(istype(O) && O.owner == src) + . = 0 // keep a good grip on your heart + /mob/living/carbon/human/unEquip(obj/item/I) . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. if(!. || !I) return - var/obj/item/organ/internal/O = I //Organs shouldn't be removed unless you call droplimb. - if(istype(O) && O.owner == src) - return - if(I == wear_suit) if(s_store) unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.