diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index 0b6d4e3404..e806e7f2f3 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -21,7 +21,7 @@ return FALSE - if(!(type in D.viable_mobtypes)) + if(!D.infectable_mobtypes[type]) return FALSE return TRUE diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 940b61c9fe..bbbb16e94b 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -18,7 +18,6 @@ var/stage_prob = 4 //Other - var/list/viable_mobtypes = list() //typepaths of viable mobs var/mob/living/carbon/affected_mob = null var/list/cures = list() //list of cures if the disease has the CURABLE flag, these are reagent ids var/infectivity = 65 @@ -30,10 +29,17 @@ var/list/required_organs = list() var/needs_all_cures = TRUE var/list/strain_data = list() //dna_spread special bullshit + var/list/viable_mobtypes //typecache of viable mobs passed down the below variable. + var/list/infectable_mobtypes = list() var/infectable_biotypes = MOB_ORGANIC //if the disease can spread on organics, synthetics, or undead var/process_dead = FALSE //if this ticks while the host is dead var/copy_type = null //if this is null, copies will use the type of the instance being copied +/datum/disease/New() + ..() + if(viable_mobtypes) + infectable_mobtypes = typecacheof(viable_mobtypes) + /datum/disease/Destroy() . = ..() if(affected_mob)