ID:147423
 
runtime error: Cannot read null.name
proc name: SaveMob (/client/proc/SaveMob)
source file: Character-Handling.dm,20
usr: null
src: XzDoG (/client)
call stack:
XzDoG (/client): SaveMob()
XzDoG (/client): Del()
Del()
CreateNewCharacter()
LoadCharacter()
LoadCharacter (145,142,2) (/turf/Character_Creation/LoadCharacter): Click(LoadCharacter (145,142,2) (/turf/Character_Creation/LoadCharacter))
Connection died.

Thats the error above, heres the code


client/proc/SaveMob()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("player/[firstletter]/[src.ckey].sav")
Line 20>-var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"]<<src.mob
now this happens when i load a new character, can anyone help me fix this at all?
XzDoG wrote:
runtime error: Cannot read null.name
proc name: SaveMob (/client/proc/SaveMob)
source file: Character-Handling.dm,20
usr: null
src: XzDoG (/client)
call stack:
XzDoG (/client): SaveMob()
XzDoG (/client): Del()
Del()
CreateNewCharacter()
LoadCharacter()
LoadCharacter (145,142,2) (/turf/Character_Creation/LoadCharacter): Click(LoadCharacter (145,142,2) (/turf/Character_Creation/LoadCharacter))
Connection died.

Thats the error above, heres the code


> client/proc/SaveMob()
> var/firstletter=copytext(src.ckey, 1, 2)
> var/savefile/F = new("player/[firstletter]/[src.ckey].sav")
> Line 20>-var/char_ckey = cKey(src.mob.name)
> F["/[ckey]/[char_ckey]"]<<src.mob
now this happens when i load a new character, can anyone help me fix this at all?

Ok, lets end this. Anyway, it could have something to do with your turf...I'm not 100% sure, though.
In response to SSJ4_Gohan_Majin
Actually i needed to add src.client.mob = new_char. in the creation so i fixed it, thanks for your help anyways.
In response to XzDoG
It's probably because the client's mob doesn't exist yet, or, it's in the middle of transferring. Just make a simple if() check to make sure client.mob still exists.