world/proc
SaveObjects()
var/savefile/F = new ("Objs.sav")
var/objs[0]
for(var/obj/item/furniture/o in world)
o.saved_x = o.x
o.saved_y = o.y
o.saved_z = o.z
objs.Add(o)
F["Objects"] << objs
LoadObjects()
var/savefile/F = new("Objs.sav")
var/objs[0]
world.log << "Loading Objects"
if(isnull(objs)) objs = new/list()
F["Objects"] >> objs
if(length(objs))
for(var/obj/item/furniture/o in objs)
o.loc = locate(o.saved_x, o.saved_y, o.saved_z)
objs.Remove(o)
objs.Cut()
Save_House_Layout()
var/savefile/F = new("List.sav")
world.log << "Saving House Layout"
for(var/turf/walls/SPwall/W in world)
W.saved_ic = W.icon_state
SPwall.Add(W)
F["House wall"] << SPwall
Load_House_Layout()
var/savefile/F = new("List.sav")
world.log << "Loading House Layout"
if(isnull(SPwall)) SPwall = new/list()
F["House wall"] >> SPwall
for(var/turf/walls/SPwall/W in world)
W.icon_state = W.saved_ic
if(W.icon_state == "Floor")
W.density = 0
Problem description:
Is there a more efficient way to save the House tile iconstates and save the objs, that will cause the least amount of lag? Because I need it to so I can have it save periodically.