fixes a memory leak with mannequins and the issue that then comes with fixing it (#8942)

* fixes a memory leak with mannequins and the issue of non-derobotizing limbs on preference mannequins that comes with fixing it

* almost didn't see that
This commit is contained in:
Seris02
2023-02-18 21:35:54 -08:00
committed by GitHub
parent 9bae8da4d4
commit 4bb5562d97
9 changed files with 100 additions and 15 deletions
@@ -349,7 +349,9 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
var/status = pref.organ_data[name]
var/obj/item/organ/external/O = character.organs_by_name[name]
if(O)
if(status == "amputated")
if(status == null)
O.derobotize()
else if(status == "amputated")
O.remove_rejuv()
else if(status == "cyborg")
if(pref.rlimb_data[name])
@@ -359,15 +361,15 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
for(var/name in list(O_HEART,O_EYES,O_VOICE,O_LUNGS,O_LIVER,O_KIDNEYS,O_SPLEEN,O_STOMACH,O_INTESTINE,O_BRAIN))
var/status = pref.organ_data[name]
if(!status)
continue
var/obj/item/organ/I = character.internal_organs_by_name[name]
if(istype(I, /obj/item/organ/internal/brain))
var/obj/item/organ/external/E = character.get_organ(I.parent_organ)
if(E.robotic < ORGAN_ASSISTED)
continue
if(I)
if(status == "assisted")
if(status == null)
I.derobotize()
else if(status == "assisted")
I.mechassist()
else if(status == "mechanical")
I.robotize()