ID:149354
 
mob
proc
Add_Hp()
if(usr.max_hits <=8 && usr.max_hits>=6)
if(usr.hits==usr.max_hits)
return
else if(usr.hits < 9 && usr.hits > 4)
for(var/obj/hearts/heart2/H in usr.client.screen)
var/is = 0
is = text2num(H.icon_state - 4)
is += 2
H.icon_state = num2text(is)
usr.hits += 2
else if(usr.max_hits == 9)
return

Check_Hp()
if(usr.hits == 0)
return
else
for(var/obj/hearts/heart2/H in usr.client.screen)
var/is = 0
is = text2num(H.icon_state-4)
H.icon_state = num2text(is)


The code doesn't do anything and when I run the proc it says this
runtime error: type mismatch
proc name: Add Hp (/mob/proc/Add_Hp)
usr: SSJ4_Link (/mob/link)
src: SSJ4_Link (/mob/link)
call stack:
SSJ4_Link (/mob/link): Add Hp()
SSJ4_Link (/mob/link): move(2)
SSJ4_Link (/client): South()

I think that might be because it's ran in this proc.
mob/proc/move(step_dir)
step(src,step_dir)
for(var/obj/sword/wood/inv/I in loc)
sleep(4)
I.pixel_y+=32
usr.icon_state="get small"
usr.hitting=1
usr.sword=1
spawn(30)del I
spawn(30)usr.icon_state=""
spawn(30)usr.hitting=0
sleep(100)
I=new()
break
for(var/obj/heart/H in loc)
if(usr.hits<usr.max_hits)
Add_Hp()
del H
else
del H

So if you could find out what is wrong that would be great.