From d4551fa3c79fac6904f9c20fbd44e95350220ebe Mon Sep 17 00:00:00 2001 From: Lucy Date: Mon, 6 Jan 2025 21:15:02 -0500 Subject: [PATCH] [NO GBP] *Properly* rebuild plane masters after client login if switching between 515 and 516 (#88829) ## About The Pull Request so i discovered this downstream, but forgot to pr upstream til now, the proper way to rebuild planemasters is `rebuild_hud`, not directly calling `rebuild_plane_masters` ## Why It's Good For The Game whoopsie breaking graphics is bad ## Changelog :cl: fix: Fixed graphics getting screwed up when reconnecting with BYOND 515 after playing on BYOND 516. /:cl: --- code/_onclick/hud/hud.dm | 16 ++++++++++++---- code/modules/client/client_defines.dm | 4 ---- code/modules/client/client_procs.dm | 8 -------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index ae1e619763f..b916a83b947 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -106,6 +106,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list( // and avoid needing to make changes to all idk 300 consumers if we want to change the appearance var/list/asset_refs_for_reuse = list() + /// The BYOND version of the client that was last logged into this mob. + /// Currently used to rebuild all plane master groups when going between 515<->516. + var/last_byond_version + /datum/hud/New(mob/owner) mymob = owner @@ -153,13 +157,17 @@ GLOBAL_LIST_INIT(available_ui_styles, list( /datum/hud/proc/client_refresh(datum/source) SIGNAL_HANDLER var/client/client = mymob.canon_client - if(client.rebuild_plane_masters) - var/new_relay_loc = (client.byond_version > 515) ? "1,1" : "CENTER" + var/new_byond_version = client.byond_version +#if MIN_COMPILER_VERSION > 515 + #warn Fully change default relay_loc to "1,1", rather than changing it based on client version +#endif + if(!isnull(last_byond_version) && new_byond_version != last_byond_version) + var/new_relay_loc = (new_byond_version > 515) ? "1,1" : "CENTER" for(var/group_key as anything in master_groups) var/datum/plane_master_group/group = master_groups[group_key] group.relay_loc = new_relay_loc - group.rebuild_plane_masters() - client.rebuild_plane_masters = FALSE + group.rebuild_hud() + last_byond_version = new_byond_version RegisterSignal(client, COMSIG_CLIENT_SET_EYE, PROC_REF(on_eye_change)) on_eye_change(null, null, client.eye) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index fe559b2b71b..c8e9e9a64c2 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -269,7 +269,3 @@ ///Which ambient sound this client is currently being provided. var/current_ambient_sound - - /// Does this client's mob need to rebuild its plane masters after login? - /// This is currently only used so a client can switch between 515 and 516 without breaking their rendering. - var/rebuild_plane_masters = FALSE diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 36ca38124a2..df19de2fb1c 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -332,16 +332,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(GLOB.player_details[ckey]) reconnecting = TRUE player_details = GLOB.player_details[ckey] - var/old_version = player_details.byond_version player_details.byond_version = byond_version player_details.byond_build = byond_build - -#if MIN_COMPILER_VERSION > 516 - #warn Fully change default relay_loc to "1,1", rather than changing it based on client version -#endif - if(old_version != byond_version) - rebuild_plane_masters = TRUE - else player_details = new(ckey) player_details.byond_version = byond_version