Fixes hydroponics update_icon() runtime.

Rounding could cause plant maturation to have a value of 0.
This commit is contained in:
PsiOmega
2015-03-10 08:16:20 +01:00
parent 28a7f6bc95
commit a86c16b3e3

View File

@@ -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)