Skip to content

Commit

Permalink
Resend maps every ui open
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Nov 12, 2023
1 parent 43b4ecc commit 3067be6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
13 changes: 7 additions & 6 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions code/modules/admin/tacmap_panel/tacmap_admin_panel_tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@

if(observer.client)
observer.client.change_view(world_view_size)
send_tacmap_assets_latejoin(observer)

observer.set_huds_from_prefs()

Expand Down Expand Up @@ -282,7 +281,6 @@
msg_admin_niche("NEW PLAYER: <b>[key_name(character, 1, 1, 0)]</b>. 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: <b>[key_name(character, 0, 1, 0)]</b> 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)
Expand Down

0 comments on commit 3067be6

Please sign in to comment.