No longer drop bodyparts still in use

This commit is contained in:
Crazylemon64
2016-07-22 16:54:08 -07:00
parent c2092ac2d0
commit ca20966b96
3 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -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)
+2 -1
View File
@@ -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]"
hud_used.internals.icon_state = "internal[internal_state]"
@@ -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.