I have an object with an icon which I want to get the icon states for. I set a var/icon/I to equal the objects icon, then I set a var/list/L to equal I.IconStates. When that part of the program executes, I get a runtime-error reading "cannot execute null.IconStates()".
//my code
client/proc/pic(icon/icon)
view=1
var/obj/O=new
O.icon=icon;O.loc=mob.loc;O.icon_state="3,3"
var/icon/I=O.icon
if(I)
var/list/L=I.IconStates()
//end code
I added in the view=1 and the loc/icon_state for O just to make sure that it did have an icon. I even added the if(I) to make the line only run if I is not null. I don't see why I'm getting a "cannot execute null.IconStates()" error since I is definately not null.
As allways, all help appreciated.