if(initialized && named)
var/savefile/D = new(SAVEFILE_PATH("timer"))
var/savefile/Z = new(SAVEFILE_PATH("[current_slot]o"))
var/savefile/F = new(SAVEFILE_PATH(current_slot))
Last_x = x
Last_y = y
Last_z = z
F << src
var/savefile/F = new(SAVEFILE_PATH(slotty))
var/mob/M = src
F >> M
initialized = 1
loc = locate(Last_x,Last_y,Last_z)
This is my nasty Save and Load code. I wrote this when I was a very inexperienced programmer, and tbh, I don't really know how to fix it because I still don't quite understand how Byond handles Saving and Loading.
The issue I'm having is, whenever a player logs out, which procs Save_Player(), the server freezes for a few seconds. Same thing happens when a character logs in and loads Load_Player(). I have absolutely no idea why this is happening or how to fix it. Any ideas?
Thanks for your time!
Edit: would having a bunch of "garbage variables" in my source code be a potential issue? In other words, would going through my source, and making sure every variable that should be marked tmp is tmp, and deleting old variables no longer being used? I don't know if that is inflating save files and making the Read/Write time longer?