Reverts sav file persistance for poly/pun-pun (#2654)

* Reverts sav file persistance for poly/pun-pun

* makes sure poly writes to poly
This commit is contained in:
Poojawa
2017-09-08 06:58:08 -05:00
committed by GitHub
parent ed4488bd1d
commit ce787e7726
7 changed files with 108 additions and 177 deletions
+10 -18
View File
@@ -42,23 +42,15 @@
..()
/mob/living/carbon/monkey/punpun/proc/Read_Memory()
if(fexists("data/npc_saves/Punpun.sav")) //legacy compatability to convert old format to new
var/savefile/S = new /savefile("data/npc_saves/Punpun.sav")
S["ancestor_name"] >> ancestor_name
S["ancestor_chain"] >> ancestor_chain
S["relic_hat"] >> relic_hat
S["relic_mask"] >> relic_mask
fdel("data/npc_saves/Punpun.sav")
else
var/json_file = file("data/npc_saves/Punpun.json")
if(!fexists(json_file))
return
var/list/json = list()
json = json_decode(file2text(json_file))
ancestor_name = json["ancestor_name"]
ancestor_chain = json["ancestor_chain"]
relic_hat = json["relic_hat"]
relic_mask = json["relic_hat"]
var/json_file = file("data/npc_saves/Punpun.json")
if(!fexists(json_file))
return
var/list/json = list()
json = json_decode(file2text(json_file))
ancestor_name = json["ancestor_name"]
ancestor_chain = json["ancestor_chain"]
relic_hat = json["relic_hat"]
relic_mask = json["relic_hat"]
/mob/living/carbon/monkey/punpun/proc/Write_Memory(dead, gibbed)
var/json_file = file("data/npc_saves/Punpun.json")
@@ -78,4 +70,4 @@
fdel(json_file)
WRITE_FILE(json_file, json_encode(json_file))
if(!dead)
memory_saved = 1
memory_saved = 1