ID:2546322
 
Is there a more efficient way to create stat bars without using a million different icon states?

How would I go about doing so?
for(var/obj/stambar/s in usr.client.screen)
if(s.segment>=2)
s:owns = usr
var/a=0

a=S - (s.segment-2)*32
if(a>32)
a=32
if(a<0)
a=0
s.icon_state="[a]"
http://www.byond.com/forum/post/2466493

This was posted before BYOND gained the alpha filter, but the idea remains the same.
There is no stat/health bar code that could possibly justify the use of usr. You're clearly doing this inside of a proc, and therefore should not be using usr.