mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Fix for the following runtime.
runtime error: Cannot read null.viruses proc name: cure (/datum/disease/proc/cure) source file: disease.dm,156 usr: null src: The Flu (/datum/disease/flu) call stack: The Flu (/datum/disease/flu): cure(0) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4097 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -145,18 +145,14 @@ to null does not delete the object itself. Thank you.
|
|||||||
return
|
return
|
||||||
|
|
||||||
/datum/disease/proc/cure(var/resistance=1)//if resistance = 0, the mob won't develop resistance to disease
|
/datum/disease/proc/cure(var/resistance=1)//if resistance = 0, the mob won't develop resistance to disease
|
||||||
if(resistance && affected_mob && !(type in affected_mob.resistances))
|
if(affected_mob)
|
||||||
// world << "Setting res to [src]"
|
if(resistance && !(type in affected_mob.resistances))
|
||||||
var/saved_type = "[type]"//copy the value, not create the reference to it, so when the object is deleted, the value remains.
|
var/saved_type = "[type]"
|
||||||
affected_mob.resistances += text2path(saved_type)
|
affected_mob.resistances += text2path(saved_type)
|
||||||
if((affected_mob) && (istype(src, /datum/disease/alien_embryo)))//Get rid of the flag.
|
if(istype(src, /datum/disease/alien_embryo)) //Get rid of the infection flag if it's a xeno embryo.
|
||||||
affected_mob.status_flags &= ~(XENO_HOST)
|
affected_mob.status_flags &= ~(XENO_HOST)
|
||||||
// world << "Removing [src]"
|
affected_mob.viruses -= src //remove the datum from the list
|
||||||
spawn(0)
|
del(src) //delete the datum to stop it processing
|
||||||
affected_mob.viruses -= src //I am a silly person for trying affected_mob.viruses.Find(src_type) instead of what it's like now and getting LOL WHAT IS THIS PROC
|
|
||||||
del(src) //IT'LL TAKE MORE THAN A LIST REMOVE TO DEFEAT US!
|
|
||||||
//world <<"Virus deleted successfully."
|
|
||||||
//world <<"Cured the disease, deleting virus..."
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user