From b128c3af7b941e3ee098aa33db695d077ba95153 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 7 Mar 2025 07:48:14 -0700 Subject: [PATCH] [MIRROR] fix gradient selection (#10328) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- .../preference_setup/general/03_body.dm | 22 +++++++++++++++++++ code/modules/mob/living/carbon/human/human.dm | 5 ++--- code/modules/mob/new_player/new_player.dm | 3 +++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index dfecb880f9..80f38d4473 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -616,6 +616,28 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.grad_style = new_grad_style return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["grad_style_left"]) + var/H = href_list["grad_style_left"] + var/list/valid_gradients = GLOB.hair_gradients + var/start = valid_gradients.Find(H) + + if(start != 1) //If we're not the beginning of the list, become the previous element. + pref.grad_style = valid_gradients[start-1] + else //But if we ARE, become the final element. + pref.grad_style = valid_gradients[valid_gradients.len] + return TOPIC_REFRESH_UPDATE_PREVIEW + + else if(href_list["grad_style_right"]) + var/H = href_list["grad_style_right"] + var/list/valid_gradients = GLOB.hair_gradients + var/start = valid_gradients.Find(H) + + if(start != valid_gradients.len) //If we're not the end of the list, become the next element. + pref.grad_style = valid_gradients[start+1] + else //But if we ARE, become the first element. + pref.grad_style = valid_gradients[1] + return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["hair_style_left"]) var/H = href_list["hair_style_left"] var/list/valid_hairstyles = pref.get_valid_hairstyles(user) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ed18b965cb..179e3c04ca 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1330,9 +1330,8 @@ var/datum/mob_descriptor/descriptor = species.descriptors[desctype] descriptors[desctype] = descriptor.default_value - //This was the old location of initialize_vessel. A race condiiton happened here because of species code being JANK. This resulted in runtimes during unit test, but worked perfectly fine in game. - //Now, initialize_vessel has been moved to human/Initialize() - // addtimer(CALLBACK(src, PROC_REF(initialize_vessel)), 0, TIMER_DELETE_ME) //Doing ASYNC fails here. This used to be a spawn(0) + if(vessel) + initialize_vessel() // Rebuild the HUD. If they aren't logged in then login() should reinstantiate it for them. update_hud() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 3b48789dd7..c78a11c9ee 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -184,6 +184,9 @@ new_player_panel_proc() if(href_list["observe"]) + if(!SSticker || SSticker.current_state == GAME_STATE_INIT) + to_chat(src, span_warning("The game is still setting up, please try again later.")) + return 0 if(tgui_alert(src,"Are you sure you wish to observe? If you do, make sure to not use any knowledge gained from observing if you decide to join later.","Observe Round?",list("Yes","No")) == "Yes") if(!client) return 1