From fc2e10fc3c34538305fbed485fc027746a01bc01 Mon Sep 17 00:00:00 2001 From: Drsmail <60036448+Drsmail@users.noreply.github.com> Date: Sun, 26 Jan 2025 09:32:40 +0300 Subject: [PATCH] Prevents TGUI crash when slime tries to feed with 0 valid targets (#28031) * Prevents TGUI Crush when 0 targets was found. * ! Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Signed-off-by: Drsmail <60036448+Drsmail@users.noreply.github.com> --------- Signed-off-by: Drsmail <60036448+Drsmail@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> --- code/modules/mob/living/simple_animal/slime/slime_powers.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/modules/mob/living/simple_animal/slime/slime_powers.dm b/code/modules/mob/living/simple_animal/slime/slime_powers.dm index cb536acb6bb..d61574cc4ee 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_powers.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_powers.dm @@ -29,6 +29,10 @@ if(C!=src && Adjacent(C)) choices += C + if(!length(choices)) + to_chat(src, "No subjects nearby to feed on!") + return + var/mob/living/M = tgui_input_list(src, "Who do you wish to feed on?", "Feeding Selection", choices) if(!M) return FALSE