From 731f8f7f5b993ce46ee74ae0bfd9e5cf5ed4aef0 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Mon, 18 Apr 2022 23:24:21 -0700 Subject: [PATCH] Fix things breaking in tgui if the asset transport type is changed mid round (#66317) This bug breaks disabling the cdn mid round if the cdn is broken, as well as enabling it mid round if it started the round disabled. some things fail back to byond transfers, but not all things. --- code/modules/asset_cache/asset_list.dm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/asset_cache/asset_list.dm b/code/modules/asset_cache/asset_list.dm index bf804e34f2f..56517fd7c6e 100644 --- a/code/modules/asset_cache/asset_list.dm +++ b/code/modules/asset_cache/asset_list.dm @@ -12,7 +12,8 @@ GLOBAL_LIST_EMPTY(asset_datums) /datum/asset var/_abstract = /datum/asset - var/cached_url_mappings + var/cached_serialized_url_mappings + var/cached_serialized_url_mappings_transport_type /// Whether or not this asset should be loaded in the "early assets" SS var/early = FALSE @@ -31,10 +32,11 @@ GLOBAL_LIST_EMPTY(asset_datums) /// Returns a cached tgui message of URL mappings /datum/asset/proc/get_serialized_url_mappings() - if (isnull(cached_url_mappings)) - cached_url_mappings = TGUI_CREATE_MESSAGE("asset/mappings", get_url_mappings()) + if (isnull(cached_serialized_url_mappings) || cached_serialized_url_mappings_transport_type != SSassets.transport.type) + cached_serialized_url_mappings = TGUI_CREATE_MESSAGE("asset/mappings", get_url_mappings()) + cached_serialized_url_mappings_transport_type = SSassets.transport.type - return cached_url_mappings + return cached_serialized_url_mappings /datum/asset/proc/register() return