world
New()
if(fexists("MAP.dat"))
load_worldvars()
if(load_world)
loadmap()
else
createmap()
for(var/turf/Trees/T in world)
T.AutoJoin()
else
createmap()
for(var/turf/Trees/T in world)
T.AutoJoin()
haspopd = 1
..()
Del()
if(save_map)
savemap()
load_world = 1
save_worldvars()
..()
proc
savemap()
var/dmp_writer/D = new()
var/turf/south_west_deep = locate(1,1,2)
var/turf/north_east_shallow = locate(100,100,2)
D.save_map(south_west_deep, north_east_shallow, "MAP", flags = DMP_IGNORE_PLAYERS)
loadmap()
var/dmp_reader/new_reader = new()
//need to set new_reader Z to 2, not 3...
new_reader.load_map("MAP.dat")
save_worldvars()
if(!fexists("globals.sav")) //check if the file exists first
return 0 //if it doesn't, stop
var/savefile/F = new("globals.sav")
F << load_world
F << speed
load_worldvars()
if(!fexists("globals.sav")) //check if the file exists first
return 0 //if it doesn't, stop
var/savefile/F = new("globals.sav")
F >> load_world
F >> speed
Problem description:
Im using the dmp_reader and dmp_writer libraries. I want the code to save the FULL map with Z level of 2 if save_map is true, and some world vars as well. The problem is that even if save_map is true nothing is saved or loaded.