ID:154978
 
I'm trying to rotate a mob's icon and overlays when he dies by 90 degrees using turn(). The mob rotating works but since overlay is a list, I can't figure out how to turn it. I tried for() to turn every obj in mob's overlays list but it doesn't works.

And the overlays are derived from /obj. Any help is appreciated.
Why don't you just turn the mob itself?
In response to Lugia319
Lugia319 wrote:
Why don't you just turn the mob itself?

Will that turn its overlays as well?
In response to Hashee
It should, assuming that icon states exist for those directions. But it'd be much quicker if you just tried the code and came back saying "it works" or "it doesn't work" than to have asked me this.
In response to Lugia319
It doesn't work. Perhaps, I'm doing it wrong? Here is the code.

body.icon = src.icon
body.overlays = src.overlays
body.icon = turn(body.icon, 90)
In response to Hashee
Yes, you're trying the icon. Just do the mob.

src.dir = turn(src.dir,90)

I do want to note that this will turn a person a direction depending on which direction they died. I assume you mean to standardize death direction, so set the direction to that direction.

src.dir = SOUTH