ID:144848
 
Code:
mob/proc
fight(mob/M)
var/clr = colour2html("black")
var/dmg = src.att + src.weppwr
M.hp -= dmg
s_damage(M,dmg,clr)
M << "[src] attacks you!!"
src<<"You attack [M]!!"
dcheck(M)


Problem description:
I get this runtime error when this proc is called.
runtime error: Cannot read null.hp
proc name: fight (/mob/proc/fight)
I tried to fix it but thats very hard to do when you can't tell what's wrong.
How are you calling fight, exactly? Also, your dcheck is backwards. M appears to be the victim. In dcheck, src should be the victim, and the attacker should be passed. M.check(src).
In response to Audeuro
It is called with bump which works because I tested it by replacing the proc with a message.
Also M is the victim the're the one loosing health.
So I should switch src and M around?
In response to Hellsing4
Show us your Bump, and just switch around M and src so that when you call DCheck, the victim is src in it, and the attacker is passed to the proc. That one is fine as it is.
In response to Audeuro
I'm just gonna do it a different way so nevermind thanks anyway though.