Doesn't Rejuvenate Limbs or Organs if ones Exist on Mob...

... with the same limb name (in the case of external organs) or the same slot (in the case of internal organs) to prevent duplication.
This commit is contained in:
KasparoVy
2016-05-18 23:59:12 -04:00
parent 763db82dca
commit 701df43ee0
5 changed files with 40 additions and 14 deletions
+6 -1
View File
@@ -40,4 +40,9 @@
return O
/proc/is_int_organ(atom/A)
return istype(A, /obj/item/organ/internal)
return istype(A, /obj/item/organ/internal)
/mob/living/carbon/human/proc/get_limb_by_name(limb_name) //Look for a limb with the given limb name in the source mob, and return it if found.
for(var/obj/item/organ/external/O in organs)
if(limb_name == O.limb_name)
return O
+6 -1
View File
@@ -176,7 +176,12 @@ var/list/organ_cache = list()
/obj/item/organ/proc/rejuvenate()
damage = 0
germ_level = 0
status &= ~ORGAN_DEAD
if(status & ORGAN_ROBOT) //Robotic organs stay robotic.
status = ORGAN_ROBOT
else if (status & ORGAN_ASSISTED) //Assisted organs stay assisted.
status = ORGAN_ASSISTED
else
status = 0
if(!owner)
processing_objects |= src
@@ -308,8 +308,10 @@ This function completely restores a damaged organ to perfect condition.
*/
/obj/item/organ/external/rejuvenate()
damage_state = "00"
if(status & 128) //Robotic organs stay robotic.
status = 128
if(status & ORGAN_ROBOT) //Robotic organs stay robotic.
status = ORGAN_ROBOT
else if (status & ORGAN_ASSISTED) //Assisted organs stay assisted.
status = ORGAN_ASSISTED
else
status = 0
germ_level = 0