proc
Update_Enemy(mob/M as mob)
for(var/obj/Enemy/C in M.client.screen)
C.icon_state="1"
for(var/mob/L in world)
for(L in view())
if(M == L) return
if(L)
C.icon_state="2"
else
C.icon_state="1"
ID:148312
Apr 11 2003, 1:37 pm
|
|
Its a Hud, its suppost to change if theres a mob in the view of the person, But it doesnt, so there must be somthing im doing wrong. Does any one know?
|
Wanabe wrote:
if(L) That if() is a little troubling. L will always be non-null during the loop, so the C.icon_state="1" line will never even be run. Instead I'd try this: L = locate() in view(M) // I assume L has a type like /mob/monster Lummox JR |
Update_Enemy(mob/M as mob)
for(var/obj/Enemy/C in M.client.screen)
for(L in view(M))
if(M == L) return
if(L)
C.icon_state="2"
else
C.icon_state="1"
That might fix it, though I don't know what L is. Also I deleted C.icon_state="1" because if this is something that is constantly updated, your going to get it switching back and fourth between icon_states if L is true.