<commit_before>
/mob/proc/HasDisease(datum/disease/D)
	for(var/thing in viruses)
		var/datum/disease/DD = thing
		if(D.IsSame(DD))
			return 1
	return 0


/mob/proc/CanContractDisease(datum/disease/D)
	if(stat == DEAD)
		return 0

	if(D.GetDiseaseID() in resistances)
		return 0

	if(HasDisease(D))
		return 0

	if(!(type in D.viable_mobtypes))
		return 0

	return 1


/mob/proc/ContractDisease(datum/disease/D)
	if(!CanContractDisease(D))
		return 0
	AddDisease(D)


/mob/proc/AddDisease(datum/disease/D)
	for(var/datum/disease/advance/P in viruses)
		if(istype(D, /datum/disease/advance))
			var/datum/disease/advance/DD = D
			if (P.totalResistance() < DD.totalTransmittable()) //Overwrite virus if the attacker's Transmission is lower than the defender's Resistance. This does not grant immunity to the lost virus.
				P.remove_virus()

	if (!viruses.len) //Only add the new virus if it defeated the existing one
		var/datum/disease/DD = new D.type(1, D, 0)
		viruses += DD
		DD.affected_mob = src
		SSdisease.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.

		//Copy properties over. This is so edited diseases persist.
		var/list/skipped = list("affected_mob","holder","carrier","stage","type","parent_type","vars","transformed","symptoms")
		for(var/V in DD.vars)
			if(V in skipped)
				continue
			if(islist(DD.vars[V]))
				var/list/L = D.vars[V]
				DD.vars[V] = L.Copy()
			else
				DD.vars[V] = D.vars[V]

		DD.affected_mob.med_hud_set_status()


/mob/living/carbon/ContractDisease(datum/disease/D)
	if(!CanContractDisease(D))
		return 0
<commit_msg>Fixes viruses not calling Start on their symptoms when spreading<commit_after>
/mob/proc/HasDisease(datum/disease/D)
	for(var/thing in viruses)
		var/datum/disease/DD = thing
		if(D.IsSame(DD))
			return 1
	return 0


/mob/proc/CanContractDisease(datum/disease/D)
	if(stat == DEAD)
		return 0

	if(D.GetDiseaseID() in resistances)
		return 0

	if(HasDisease(D))
		return 0

	if(!(type in D.viable_mobtypes))
		return 0

	return 1


/mob/proc/ContractDisease(datum/disease/D)
	if(!CanContractDisease(D))
		return 0
	AddDisease(D)


/mob/proc/AddDisease(datum/disease/D)
	for(var/datum/disease/advance/P in viruses)
		if(istype(D, /datum/disease/advance))
			var/datum/disease/advance/DD = D
			if (P.totalResistance() < DD.totalTransmittable()) //Overwrite virus if the attacker's Transmission is lower than the defender's Resistance. This does not grant immunity to the lost virus.
				P.remove_virus()

	if (!viruses.len) //Only add the new virus if it defeated the existing one
		var/datum/disease/DD = new D.type(1, D, 0)
		viruses += DD
		DD.affected_mob = src
		SSdisease.active_diseases += DD //Add it to the active diseases list, now that it's actually in a mob and being processed.

		//Copy properties over. This is so edited diseases persist.
		var/list/skipped = list("affected_mob","holder","carrier","stage","type","parent_type","vars","transformed","symptoms","processing")
		for(var/V in DD.vars)
			if(V in skipped)
				continue
			if(islist(DD.vars[V]))
				var/list/L = D.vars[V]
				DD.vars[V] = L.Copy()
			else
				DD.vars[V] = D.vars[V]

		DD.affected_mob.med_hud_set_status()


/mob/living/carbon/ContractDisease(datum/disease/D)
	if(!CanContractDisease(D))
		return 0

{'fraction_non_alphanumeric': 0.1322289156626506, 'fraction_numerical': 0.006626506024096385, 'mean_word_length': 3.898230088495575, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '648140', 'n_tokens_mistral': 1444, 'n_tokens_neox': 1212, 'n_words': 293}