From 2f9182b6a6c00d56d3612da4307a51bf39b34922 Mon Sep 17 00:00:00 2001 From: Adrer Date: Mon, 16 Sep 2024 16:54:50 +0200 Subject: [PATCH] [RUNTIME] Fixes trying to open the head marking menu for certain IPC heads. (#26701) * You can no longer attempt to open the head markings menu for certain IPC heads with no possible markings. * Added a TGUI alert * Update code/modules/client/preference/link_processing.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: Adrer --------- Signed-off-by: Adrer Co-authored-by: Adrer Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/modules/client/preference/link_processing.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/client/preference/link_processing.dm b/code/modules/client/preference/link_processing.dm index b6aaaaabea8..99966235522 100644 --- a/code/modules/client/preference/link_processing.dm +++ b/code/modules/client/preference/link_processing.dm @@ -476,6 +476,9 @@ valid_markings += markingstyle sortTim(valid_markings, GLOBAL_PROC_REF(cmp_text_asc)) + if(!length(valid_markings)) // Some IPC head models do have head markings, some don't; This is here to prevent us from attempting to open an empty TGUI list + tgui_alert(user, "No head markings available for this head!", "Character Preference") + return var/new_marking_style = tgui_input_list(user, "Choose the style of your character's head markings:", "Character Preference", valid_markings) if(new_marking_style) active_character.m_styles["head"] = new_marking_style