mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #10949 from VOREStation/Arokha/persistcross
More painting tweaks
This commit is contained in:
committed by
Chompstation Bot
parent
7e10238662
commit
a0b482e956
@@ -8,16 +8,17 @@
|
||||
/datum/persistent/paintings/Initialize()
|
||||
. = ..()
|
||||
if(fexists(filename))
|
||||
SSpersistence.paintings = json_decode(file2text(filename))
|
||||
var/list/tokens = SSpersistence.paintings
|
||||
SSpersistence.all_paintings = json_decode(file2text(filename))
|
||||
var/list/tokens = SSpersistence.all_paintings
|
||||
for(var/list/token in tokens)
|
||||
token["age"]++ // Increment age!
|
||||
if(!CheckTokenSanity(token))
|
||||
tokens -= token
|
||||
|
||||
|
||||
SSpersistence.unpicked_paintings = SSpersistence.all_paintings.Copy()
|
||||
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
P.load_persistent()
|
||||
return
|
||||
|
||||
/datum/persistent/paintings/CheckTokenSanity(var/list/token)
|
||||
var/png_filename = "data/paintings/[token["persistence_id"]]/[token["md5"]].png"
|
||||
@@ -33,4 +34,4 @@
|
||||
|
||||
if(fexists(filename))
|
||||
fdel(filename)
|
||||
to_file(file(filename), json_encode(SSpersistence.paintings))
|
||||
to_file(file(filename), json_encode(SSpersistence.all_paintings))
|
||||
|
||||
Reference in New Issue
Block a user