From a86c16b3e325e08209e1e60c71fcc0d4d170b302 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 10 Mar 2015 08:16:20 +0100 Subject: [PATCH] Fixes hydroponics update_icon() runtime. Rounding could cause plant maturation to have a value of 0. --- code/modules/hydroponics/trays/tray_update_icons.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/hydroponics/trays/tray_update_icons.dm b/code/modules/hydroponics/trays/tray_update_icons.dm index ea8fb669cd..61e19632ea 100644 --- a/code/modules/hydroponics/trays/tray_update_icons.dm +++ b/code/modules/hydroponics/trays/tray_update_icons.dm @@ -36,7 +36,8 @@ if(age >= seed.get_trait(TRAIT_MATURATION)) overlay_stage = seed.growth_stages else - overlay_stage = max(1,round(age/round(seed.get_trait(TRAIT_MATURATION)/seed.growth_stages))) + var/maturation = round(seed.get_trait(TRAIT_MATURATION)/seed.growth_stages) + overlay_stage = maturation ? max(1,round(age/maturation)) : 1 var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-[overlay_stage]" var/image/plant_overlay = plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] if(!plant_overlay)