ID:140938
 
Code:
        Playerdeath()
if(src.hp <= 0)
world << "[src] died at [src.loc]!"
src.loc = locate(2,2,1)
src.hp = maxhp
src.mana = maxmana
src.check_hp()//this dont work


Problem description:

you see its simple code, but there is one problem: when you die you hp bar shows you have less than 5% hp, but in stats it shows you have 100% hp.i dont know how to fix it and i asked some people on one game, but still no one could help me fix it.
We need to know how check_hp() works.
In response to GhostAnime (#1)
ill add small part because rest of it repeats
<DM>
mob
proc
check_hp()
if(hp/maxhp*100<99)
for(var/obj/health6/H in client.screen)
H.icon_state="1"
for(var/obj/health5/H in client.screen)
H.icon_state="full"
for(var/obj/health4/H in client.screen)
H.icon_state="full"
<DM>
In response to Martys1103 (#2)
There's your problem there, what if hp/maxhp*100 is 100 (100%) and even 99%? Nothing happens! Because it only happens if it is less than (<) 99%
In response to GhostAnime (#3)
thanks for help, changed 99 to 101