From bf901941a541245810b7742e2b42d2c1ac5b93ed Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Tue, 26 May 2026 20:53:39 +0000 Subject: [PATCH] Hydroponics: Fix invalid plant icon state from negative growth --- code/modules/hydroponics/spreading/spreading.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 734e5b201e4..9dc331b4afe 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -188,15 +188,17 @@ SHOULD_NOT_SLEEP(TRUE) overlays.Cut() - var/growth = 0 - if(growth_threshold) - growth = min(max_growth, round(health/growth_threshold)) + var/effective_max = max_growth var/at_fringe = get_dist(src,parent) if(spread_distance > 5) if(at_fringe >= (spread_distance-3)) - max_growth-- + effective_max-- if(at_fringe >= (spread_distance-2)) - max_growth-- + effective_max-- + + var/growth = 0 + if(growth_threshold) + growth = min(effective_max, round(health/growth_threshold)) var/image/our_icon = seed.get_icon(growth) @@ -205,7 +207,7 @@ AddOverlays(our_icon) - if(growth>2 && growth == max_growth) + if(growth>2 && growth == effective_max) layer = (seed && seed.force_layer) ? seed.force_layer : 5 if(growth_type in list(GROWTH_VINES,GROWTH_BIOMASS)) opacity = 1