Merge pull request #11294 from Ghommie/Ghommie-cit596

An old oversight with disease/var/viable_mobtypes.
This commit is contained in:
Lin
2020-03-02 18:31:25 -06:00
committed by GitHub
9 changed files with 19 additions and 14 deletions
+1 -1
View File
@@ -21,7 +21,7 @@
return FALSE
if(!(type in D.viable_mobtypes))
if(!D.viable_mobtypes[type])
return FALSE
return TRUE
+5 -1
View File
@@ -18,7 +18,7 @@
var/stage_prob = 4
//Other
var/list/viable_mobtypes = list() //typepaths of viable mobs
var/list/viable_mobtypes = list() //typecache 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
@@ -34,6 +34,10 @@
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(make_typecache = TRUE)
if(make_typecache && length(viable_mobtypes))
viable_mobtypes = typecacheof(viable_mobtypes)
/datum/disease/Destroy()
. = ..()
if(affected_mob)
+2 -1
View File
@@ -80,7 +80,8 @@
*/
/datum/disease/advance/New()
/datum/disease/advance/New(make_typecache = TRUE)
..()
Refresh()
/datum/disease/advance/Destroy()
+5 -5
View File
@@ -2,7 +2,7 @@
/datum/disease/advance/cold
copy_type = /datum/disease/advance
/datum/disease/advance/cold/New()
/datum/disease/advance/cold/New(make_typecache = TRUE)
name = "Cold"
symptoms = list(new/datum/symptom/sneeze)
..()
@@ -11,7 +11,7 @@
/datum/disease/advance/flu
copy_type = /datum/disease/advance
/datum/disease/advance/flu/New()
/datum/disease/advance/flu/New(make_typecache = TRUE)
name = "Flu"
symptoms = list(new/datum/symptom/cough)
..()
@@ -21,7 +21,7 @@
name = "Experimental Disease"
copy_type = /datum/disease/advance
/datum/disease/advance/random/New(max_symptoms, max_level = 8)
/datum/disease/advance/random/New(make_typecache = TRUE, max_symptoms, max_level = 8)
if(!max_symptoms)
max_symptoms = rand(1, VIRUS_SYMPTOM_LIMIT)
var/list/datum/symptom/possible_symptoms = list()
@@ -37,6 +37,6 @@
if(chosen_symptom)
var/datum/symptom/S = new chosen_symptom
symptoms += S
Refresh()
name = "Sample #[rand(1,10000)]"
name = "Sample #[rand(1,10000)]"
..()
+1 -1
View File
@@ -13,7 +13,7 @@
stage_prob = 2
var/restcure = 0
/datum/disease/dna_retrovirus/New()
/datum/disease/dna_retrovirus/New(make_typecache = TRUE)
..()
agent = "Virus class [pick("A","B","C","D","E","F")][pick("A","B","C","D","E","F")]-[rand(50,300)]"
if(prob(40))