Skip to content

Commit

Permalink
Fix bug plant keep growing (#4173)
Browse files Browse the repository at this point in the history
# About the pull request

Fixes #3368 


# Explain why it's good for the game


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog


:cl:
fix: The plant dies if no nutriment is available
/:cl:
  • Loading branch information
MikeKuwait authored Aug 14, 2023
1 parent 11a565b commit eb43695
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/modules/hydroponics/hydro_tray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@

// Make sure the plant is not starving or thirsty. Adequate
// water and nutrients will cause a plant to become healthier.
// Checks if there are sufficient enough nutrients, if not the plant dies.
var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER
if(seed.requires_nutrients && prob(35))
plant_health += (nutrilevel < 2 ? -healthmod : healthmod)
if(seed.requires_water && prob(35))
plant_health += (waterlevel < 10 ? -healthmod : healthmod)
if(nutrilevel < 1)
plant_health = 0

// Check that pressure, heat and light are all within bounds.
// First, handle an open system or an unconnected closed system.
Expand Down

0 comments on commit eb43695

Please sign in to comment.