From 7af96e9ca5ab46a3c50d76bdd10fa80c8495c235 Mon Sep 17 00:00:00 2001 From: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Date: Mon, 4 Oct 2021 07:56:19 -0700 Subject: [PATCH] Fix old photos (#61835) Fixes old photos in the old braindead saving system not saving. I have a backup of some photo saves starting now, but can't promise anything, and if you lost them, they're probably just gone. Finding this bug would've required some insanely frustrating testing, so I'm not too bent up about it. --- code/modules/photography/_pictures.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/photography/_pictures.dm b/code/modules/photography/_pictures.dm index cc7a404f802..fd5630206d6 100644 --- a/code/modules/photography/_pictures.dm +++ b/code/modules/photography/_pictures.dm @@ -105,7 +105,13 @@ if(!json[id]) return var/datum/picture/P = new - P.deserialize_list(json[id]) + + // Old photos were saved as, and I shit you not, encoded JSON strings. + if (istext(json[id])) + P.deserialize_json(json[id]) + else + P.deserialize_list(json[id]) + return P /proc/log_path_from_picture_ID(id)