ID:139646
 
Code:
So I recently switched all of my overlay adding to this system:
var/list
Overlays=list()
Underlays=list()
atom/proc/update()
overlays=null; underlays=null
for(var/i in Overlays) overlays+=i
for(var/i in Underlays) underlays+=i

And for all of my testing purposes, that was great. However it wasn't until I started hosting my game the silly error inside showed its ugly head. Everybody in the game who runs update() gets the overlays in Overlays, because I coded it as a world list. -.-
My question is how would I go about transfering it to suit an individuals needs? Obviously I would think the Overlays and Underlays lists would become mob/var/lists, but I get lost when it comes to update(). Would it be along the lines of
atom/proc/update()
var/list/Overlays=list()
for(var/i in src.overlays)
Overlays+=i
overlays=null; src.overlays+=Overlays

The above code does not work but that's what my mind think would be an answer.
Problem description:

mob/var/list instead of var/list.

And there's really no reason at all to do what you're doing, except I guess not actually understanding the overlays list. You don't need to remove and then re-add everything every time you add or remove just one thing.
In response to Garthor
What would be an effective alternative to what I'm using?

And when I change it to mob/var/list, I can no longer add things as Overlays+=typepath.
In response to Garthor
I suppose I could go with just adding them as images if anything.
In response to Yurokei
Whoops, meant atom/var/list, missed that you were defining the other stuff for atoms.

Though, you probably shouldn't be, because what you have here would fail if you were layering turfs using the map editor.

Anyway, my solution would be to... not do what you are doing. Don't maintain a separate list, don't reassemble the overlays every single time you change it, and just deal with the overlays list.
In response to Garthor
It's fine. I really appreciate the help.