//Part of the Deathcheck Proc, quit long, cut it down to parts that will help.
mob/proc/deathcheck(mob/M)
if(src.level<=50&&src.client&&M.health<=10)
src<<"You cannot kill [M], you are under level 50."
M.health = 10
return 0
if(M.health<=0&&!M.dead)//173
//Poison cloud...the Poison proc is called from here.
obj/PoisonCloud
layer=MOB_LAYER+3
icon = 'PBall.dmi'
icon_state = "cloud"
New()
..()
Start
for(var/mob/M in src.loc)
var/mob/O = src.owner
if(!M.poisoned)
if(!M.Kawarimi_Teleport())
M.poisoned=1
spawn(0) M.Poison(O)
spawn(5)
goto Start
spawn(100)
del(src)
//the Poison proc its self.
mob/proc
Poison(mob/M)
Start
if(src.Clan=="Human Puppet")
src.poisoned = 0
src.strongpoisoned=0
src.sasoripoisoned=0
if(src.poisoned==1)
if(!src.inimmortal)
src.health -= 50
if(src.incircle)
if(src.someoneinhidanlist)
for(var/mob/U in world)
if(src.hidanlist == U.name)
if(!U.inimmortal)
U.health-=50
src.deathcheck(U)
if(src.health<=0)
src.poisoned=0
src.deathcheck(M)
else
sleep(5)
goto Start
Problem description:
This problem will probly be something small that I have overlooked ._. I just have this feeling...ANYWAYS, the main problem is that after I poison a mob (putting the Poisoned var to 1 and calling the Poison Proc) their Health drains fine, but when their Health would hit 0, the Deathcheck proc is someone getting a null...
here is the actual runtime error that it is giving me.
runtime error: Cannot read null.health
proc name: deathcheck (/mob/proc/deathcheck)
source file: DeathCheck.dm,173
usr: 0
src: Enemy (NPC) (/mob/Enemy)
call stack:
Enemy (NPC) (/mob/Enemy): deathcheck(null)
Enemy (NPC) (/mob/Enemy): Poison(null)
New(Naruto (232,296,1) (/turf/stones))
a few things that I think it could be...
1) Poison proc is getting called Multiple times?
2) Not transfering correctly from the Poison Proc to the Deathcheck proc.
If anyone could help me with this, I would be ever so thankful.
As for your error: the argument to Poison is null. Therefore, the owner of the PoisonCloud is null.