From 97c6aa245ccfe4355d62d1d7b034844cffe661ee Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Wed, 24 Jun 2020 16:18:08 -0400 Subject: [PATCH] Adds Global Carbon and Human Lists --- code/_globalvars/lists/mobs.dm | 2 ++ code/modules/mob/living/carbon/carbon.dm | 5 +++++ code/modules/mob/living/carbon/human/human.dm | 2 ++ 3 files changed, 9 insertions(+) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 2caa158757c..17444f66207 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -18,6 +18,8 @@ GLOBAL_LIST_EMPTY(player_list) //List of all mobs **with clients attached**. GLOBAL_LIST_EMPTY(mob_list) //List of all mobs, including clientless GLOBAL_LIST_EMPTY(silicon_mob_list) //List of all silicon mobs, including clientless GLOBAL_LIST_EMPTY(mob_living_list) //all instances of /mob/living and subtypes +GLOBAL_LIST_EMPTY(carbon_list) //all instances of /mob/living/carbon and subtypes, notably does not contain simple animals +GLOBAL_LIST_EMPTY(human_list) //all instances of /mob/living/carbon/human and subtypes GLOBAL_LIST_EMPTY(spirits) //List of all the spirits, including Masks GLOBAL_LIST_EMPTY(alive_mob_list) //List of all alive mobs, including clientless. Excludes /mob/new_player GLOBAL_LIST_EMPTY(dead_mob_list) //List of all dead mobs, including clientless. Excludes /mob/new_player diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0466c1c0be0..3aef7135679 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -2,6 +2,10 @@ var/canEnterVentWith = "/obj/item/implant=0&/obj/item/clothing/mask/facehugger=0&/obj/item/radio/borg=0&/obj/machinery/camera=0" var/datum/middleClickOverride/middleClickOverride = null +/mob/living/carbon/Initialize(mapload) + . = ..() + GLOB.carbon_list += src + /mob/living/carbon/Destroy() // This clause is here due to items falling off from limb deletion for(var/obj/item in get_all_slots()) @@ -14,6 +18,7 @@ if(B) B.leave_host() qdel(B) + GLOB.carbon_list -= src return ..() /mob/living/carbon/handle_atom_del(atom/A) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 828dc25322c..9df498328fa 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -41,6 +41,7 @@ sync_organ_dna(1) UpdateAppearance() + GLOB.human_list += src /mob/living/carbon/human/OpenCraftingMenu() handcrafting.ui_interact(src) @@ -60,6 +61,7 @@ SSmobs.cubemonkeys -= src QDEL_LIST(bodyparts) splinted_limbs.Cut() + GLOB.human_list -= src /mob/living/carbon/human/dummy real_name = "Test Dummy"