ID:142109
 
Code:
/mob/verb/setTurned()
{
var/obj/mob/body/A = src.body;

for(var/atom/B in A.overlays)
{
if(src.turned != 0)
{
B.icon = turn(B.icon, 0);
}

world << B;

B.icon = turn(B.icon, 90);

src.turned = 90;

A.overlays -= B;
A.overlays += B;
}
}


Problem description:

The body and the mob have sepret overlays, except this doesn't work. It doesn't even do the 'world << B;'.
Objects in overlays are stored as a special format, not as /atom, /obj, /image, /icon, etc; since you are looping through the overlays for any /atom objects - nothing is happening (as they are in a special format as previously mentioned). This is mentioned in the DM Reference.

I forgot how you could reference to the icons in the overlays without another list to keep track... I did it a long time ago though it was not really robust... involved the colon operator and looping a general variable rather then a typecast one if I recall...
In response to GhostAnime
I can't find it.
In response to Jookia
Second paragraph (first paragraph being the one that appears after the default value) for the entry overlays var(atom):

"The individual items in the list may not be directly accessed, since they are stored in a special internal format. However, the list operators +=, -=, and the procedures Add, Remove, and Cut work normally."
In response to GhostAnime
please change your topic...
In response to Superbike32
Superbike32 wrote:
please change your topic...

He doesn't need to.

Somebody was talking about this the otherday. Lots of people were. Something about saving them in a list...
In response to Hiro the Dragon King
i know people were yesterday, thats not the point...his topic should be changed instead of just being, no topic...that doesnt explain what this post is about...