ID:2406604
 
Whenever the code is updated and the game is recompiled, upon startup everything is fine. Upon using the login command, however, things get weird.
First, the player is immediately logged out, which echoes a debugging world<< output, then logs back in, which echoes a debugging text into the window.
Then this happens two more times, getting as far as the actual login window. All outputted and visible.
After that, and the player is presented with a login window, the game will immediately crash.
I was able to freeze frame and view everything, because the permission windows will stop the game from running (sorta), thus allowing me to take a picture of it.

I've tested a few things:
- Made a new save file.
- Log out, close game world.
- Compiled the game without changing anything code-wise.
- Problem happened.

- Did the above, but with a clean compile. Same result.

- Updated to the latest version of BYOND, refreshed recompiled everything, new save files. Same result.

This is clientside only- server is seemingly unaffected by subsequent tests of loading/writing files.

As far as I can tell, it might be mishandled variables or whatever, but here is the save/load procs, along with write. Read is not used.
mob
Write(savefile/F)
..()
F.dir -="overlays"
mob/proc
Save()
if(canSave)
var/savefile/F=new("Save/[ckey]")
Write(F)
Load()
if(client)
if(fexists("Save/[ckey]"))
var/savefile/F=new("Save/[ckey]")
Read(F)
src.loc = locate(xco,yco,zco)
canSave=1
for(var/obj/hotkey/H in src.Hotkeys)H.login(src)
for(var/datum/skill/S in src.learned_skills) S.login(src)
for(var/datum/skill/tree/S in src.allowed_trees) S.login(src)
for(var/datum/skill/tree/S in src.possessed_trees) S.login(src)
verbs+=verblist
// if(src.updateseed!=resolveupdate)
// src.UpdateSkills()
// src.updateseed=resolveupdate
spawn Stats()
spawn unitimer()
else
alert("You do not have any characters on this server.")
Choose_Login()

I've taken out verbs+=verblist and other things like that. No dice.

The reason why I'm taking this here is because this does not happen on other projects as far as I am aware of- only in this specific project, so I doubt this is a specific BYOND issue and moreso probably a piece of code-or pieces- causing trouble.

Image of testing failure: https://imgur.com/MVyOWow </<>
I was wrong. It doesn't happen exclusively on compile- it happens regardless on Load. I'm convinced now that a piece of code within the login process is without a doubt causing issues.
EDIT:
Read isn't modified, yet when it is called that's what initiates the bug. What is the default Read() code?
I fixed the issue. Please update the post as such. Here is what I did:

- I copied the code from http://www.byond.com/forum/?post=2126685 nearly verbatim and integrated existing assets into it. No exceptions, no modifying the code, except for the save directory.

- After that, I made sure to disable read only in my save directory (since that was causing issues as I found later on).

- Mobs will no longer log in twice, the game gets a nice new lobby, and loading is a bit better in general (More character slots, anyone?)

Thank you Kaiochao for indirectly/directly helping me out with a code bit!