proc
SaveObjects()
var/savefile/F = new ("objects.sav")
var/list/L = new
for(var/obj/O in world)
O.saved_x = O.x
O.saved_y = O.y
O.saved_z = O.z
L += O
F[""] << L
LoadObjects()
var/savefile/F = new ("objects.sav")
var/list/L = new
F[""] >> L
if(!L) return
for(var/obj/O in world) if(O.loc) del(O)
for(var/obj/O in L)
O.loc = locate(O.saved_x,O.saved_y,O.saved_z)
I know the reason they do delete is because of the first for in Loading but if I take that out, I get a new instance of an obj thats already on the map, but now I have 2 versions of it, and every reboot it makes another one!
I need a way so that new instances that werent saved before will appear, but old ones dont get dups of them forever.
After doing that, you could load the map(the second for() in LoadObjects()) first and THEN you can do: