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'
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.