obj
var
saved_x
saved_y
saved_z
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
proc/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)
mob/verb/SaveWorld() //the save verb
set category = "Staff"
SaveObjects()
mob/verb/LoadWorld() //the load verb
set category = "Staff"
LoadObjects()
Problem description:
The problem is.. the objects load, but they load every time I host the world.. which is good, but they keep stacking up like ..
1st host) everything is fine since the .sav wasnt made
2nd host) 2 items stacked
3rd host) 3 items stacked
etc