mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
124f7ee17b
* Please describe the intent of your changes in a clear fashion. This PR addresses a server crash caused by an invalid icon state being requested for certain plants, specifically those with spreading traits like biomass vines. **Root Cause:** The `refresh_icon()` proc for `/obj/effect/plant` was directly decrementing the instance variable `max_growth` based on fringe conditions (`spread_distance` and `at_fringe`). This meant that `max_growth` could become negative over multiple processing ticks. When `seed.get_icon()` was subsequently called with a negative growth stage (e.g., -2), it constructed an invalid icon state string (e.g., `biomass--2`), leading to a crash. **Solution:** To prevent `max_growth` from being permanently altered, a local variable `effective_max` is now used within `refresh_icon()`. This local variable is initialized with the current `max_growth` and then decremented based on the fringe conditions. The `growth` calculation and subsequent icon state generation now use `effective_max`, ensuring that the persistent `max_growth` variable remains stable and positive, thus preventing the generation of invalid negative icon states. * Please make sure that, in the case of mapping changes, you include images of these changes in the PR's description. * Please make sure to mark your PR as wip or review required by making a comment with !wip or !review required * If you include sprites/sounds/... (assets) that you have not created yourself specify the license and original author below. * Ensure that you also credit them in the appropriate location / changelog as specified in the contributor guidelines ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/example.dmi | ExamplePerson (Example Station) | CC0 | Fixes SERVER-PROD-TJ --------- Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> Co-authored-by: VMSolidus <evilexecutive@gmail.com>