obj {
overlay {
timer {
icon='timer_bar.dmi'
layer=MOB_LAYER+15
var {
mob/owner = null
}
New(mob/m,max_value) {
. = ..()
owner = m
if(m.character.type==/character/commander) { del(src)}
spawn() { update(m,max_value,max_value)}
}
proc {
update(mob/m,value,max_value) {
value -= (10-m.character.speed)
if(m.can_move) { value=0;}
var show_state = ((value/max_value)*100)
for(var/i=0,i<=100,i+=4) {
if(i<=show_state) {
icon_state="[i]"
}
}
sleep(10-m.character.speed)
if(value<=0) { value=max_value;return}
update(m,value,max_value)
}
}
}
}
}
Problem description:
The overlays icons will not update. They are being added properly to according mob's, but will not change icon state at all. A fix I found was adding in
m.overlays-=src
m.overlays+=src
but all that does is add another layer on top of the one below.
I've never experienced this issue before... ideas?
[EDIT]
Nevermind, I noticed the thing was called "overlay".