ID:938812
 
(See the best response by Kozuma3.)
Code:
proc
World_Save()
if(fexists("Saves/World.sav"))
fdel("Saves/World.sav")
var/savefile/F = new("Saves/World.sav")
F["All Codes"]<<global.All_Codes

World_Load(var/savefile/F)
if(fexists("Saves/World.sav"))
F = new("Saves/World.sav")
F["All Codes"]>>global.All_Codes


Code
var
Title = "None"
Body = "None"
name = "None"
mob/Owner = null
New(Title, Body, mob/Owner)
src.name = Title
src.Title = Title
src.Body = Body
src.Owner = Owner.key


Problem description: Whenever I reboot the world, I get a runtime error? I think it's something to do with the New(mob/Owner)?

Runtime Error:
runtime error: Cannot read null.key
proc name: New (/Code/New)
source file: Datums.dm,11
usr: null
src: /Code (/Code)
call stack:
/Code (/Code): New(null, null, null)
World Load(Saves/World.sav (/savefile))
: New()

Edit: Line 11 is 'src.Owner = Owner.key'
Best response
Flysbad wrote:
Code:
> proc
> World_Save()
> if(fexists("Saves/World.sav"))
> fdel("Saves/World.sav")
No reason to delete it, it will overwrite.


[Edit] , also - there is no reason for Code/var/mob/Owner
Owner.key is a text string , not a mob.
Code
var
Title = "None"
Body = "None"
name = "None"
Owner = null
New(Title, Body, Owner)
src.name = Title
src.Title = Title
src.Body = Body
src.Owner = Owner
Also, whenever I change src.Owner = Owner.key and reboot the world, and check the owner is says "Flysbad" but whenever I make it src.Owner = Owner (i still get the problem, but the Owner has changed and it is Blank?)

Edit: I've redid what you said was wrong, and it's still giving me runtime errors?