Matrix2Icon(Info)
var/list/Matrix = Info
var/icon/I = new(icon='blank.dmi',icon_state="MMM")
for(var/x in 1 to 16)
for(var/y in 1 to 16)
I.DrawBox(Matrix[x][y],
25-x, 25-y)
var/icon/newicon = new (I)
for(var/X in 0 to 36)
I.Insert(newicon.Turn(10), "[X*10]") //the problem is caused by this
usr << ftp(I, "Icon.dmi")
Info is a 2 dimensional matrix made out of lists, by the way. Either way, what this does is turn a 16x16 matrix full of hex values into an icon. Then, it's supposed to rotate it and spit out the file for me. However, Insert() is behaving really oddly. When I comment out the for() loop it's in, the proc will give me my icon with only a single state, like it should. However, for some reason, calling Insert() makes the proc output my skin file under the name Icon.dmi. Also, if it makes a difference, I tried switching newicon's and I's roles, and it still did the same thing (even if I just took an empty icon). Also, the icon is turning properly, I checked to make sure.
2. If you keep Turn()ing the same icon after it's been turned, it'll look really ugly. You're better off having newicon = new(I) inside the loop.