From 3067be6d34519cd6e7d94c6083cd7218f9d5fe74 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sun, 12 Nov 2023 05:13:03 -0800 Subject: [PATCH] Resend maps every ui open --- code/controllers/subsystem/minimap.dm | 13 +++++++------ code/game/gamemodes/cm_initialize.dm | 2 -- .../admin/tacmap_panel/tacmap_admin_panel_tgui.dm | 3 +++ code/modules/mob/new_player/new_player.dm | 2 -- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index 36383443f794..d28fe916291a 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -256,8 +256,6 @@ SUBSYSTEM_DEF(minimaps) removal_cbs[target] = CALLBACK(src, PROC_REF(removeimage), blip, target) RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(remove_marker)) - - /** * removes an image from raw tracked lists, invoked by callback */ @@ -399,12 +397,12 @@ SUBSYSTEM_DEF(minimaps) return map_list[map_length] /** - * Sends relevant flattened tacmaps to a late joiner. + * Re-sends relevant flattened tacmaps to a single client. * * Arguments: * * user: The mob that is either an observer, marine, or xeno */ -/proc/send_tacmap_assets_latejoin(mob/user) +/proc/resend_current_map_png(mob/user) if(!user.client) return @@ -432,9 +430,9 @@ SUBSYSTEM_DEF(minimaps) * Flattens the current map and then distributes it for the specified faction as an unannounced map. * * Arguments: - * * faction: which faction to distribute the map to: FACTION_MARINE or XENO_HIVE_NORMAL + * * faction: Which faction to distribute the map to: FACTION_MARINE or XENO_HIVE_NORMAL * Return: - * * returns a boolean value, true if the operation was successful, false if it was not. + * * Returns a boolean value, TRUE if the operation was successful, FALSE if it was not (on cooldown generally). */ /datum/tacmap/drawing/proc/distribute_current_map_png(faction) if(faction == FACTION_MARINE) @@ -714,6 +712,9 @@ SUBSYSTEM_DEF(minimaps) debug_log("Failed to determine fallback wiki map! Attempted '[wiki_url]/[new_map.html_link]'") qdel(new_map) + // Ensure we actually have the map image sent + resend_current_map_png(user) + if(use_live_map) tacmap_ready_time = SSminimaps.next_fire + 2 SECONDS addtimer(CALLBACK(src, PROC_REF(on_tacmap_fire), faction), SSminimaps.next_fire - world.time + 1 SECONDS) diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index d0f0e3d40e6c..17a255009089 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -643,8 +643,6 @@ Additional game mode variables. SSround_recording.recorder.update_key(new_xeno) if(new_xeno.client) new_xeno.client.change_view(world_view_size) - if(isnewplayer(xeno_candidate)) - send_tacmap_assets_latejoin(new_xeno) msg_admin_niche("[new_xeno.key] has joined as [new_xeno].") if(isxeno(new_xeno)) //Dear lord diff --git a/code/modules/admin/tacmap_panel/tacmap_admin_panel_tgui.dm b/code/modules/admin/tacmap_panel/tacmap_admin_panel_tgui.dm index ca487d4b9e03..e4b6f6846031 100644 --- a/code/modules/admin/tacmap_panel/tacmap_admin_panel_tgui.dm +++ b/code/modules/admin/tacmap_panel/tacmap_admin_panel_tgui.dm @@ -25,6 +25,9 @@ GLOBAL_DATUM_INIT(tacmap_admin_panel, /datum/tacmap_admin_panel, new) debug_log("Failed to determine fallback wiki map! Attempted '[wiki_url]/[new_map.html_link]'") qdel(new_map) + // Ensure we actually have the latest map images sent (recache can handle older/different faction maps) + resend_current_map_png(user) + ui = new(user, src, "TacmapAdminPanel", "Tacmap Panel") ui.open() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index ff9d9f6218ff..cebe265a673c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -146,7 +146,6 @@ if(observer.client) observer.client.change_view(world_view_size) - send_tacmap_assets_latejoin(observer) observer.set_huds_from_prefs() @@ -282,7 +281,6 @@ msg_admin_niche("NEW PLAYER: [key_name(character, 1, 1, 0)]. IP: [character.lastKnownIP], CID: [character.computer_id]") if(client.player_data && client.player_data.playtime_loaded && ((round(client.get_total_human_playtime() DECISECONDS_TO_HOURS, 0.1)) <= 5)) msg_sea("NEW PLAYER: [key_name(character, 0, 1, 0)] only has [(round(client.get_total_human_playtime() DECISECONDS_TO_HOURS, 0.1))] hours as a human. Current role: [get_actual_job_name(character)] - Current location: [get_area(character)]") - send_tacmap_assets_latejoin(character) character.client.init_verbs() qdel(src)