Jump to content

Mod compatibility for regrowthmanager component


Recommended Posts

@PeterA or @Ipsquiggle

Removing certain mods can cause the game to crash. In particular, there's an issue in this regard with Rezecib's Rebalance and possibly other mods that use the regrowthmanager component. Recezib's Rebalance adds regrowth for ferns and fireflies, and their values are saved, but since they aren't registered in the vanilla component, its OnLoad function crashes if the mod is no longer present.

Changing line 255 in data/scripts/components/regrowthmanager.lua from

regrowtime = _internaltimes[k] + timerdata.regrowtime,

to

regrowtime = (_internaltimes[k] or CARROT_REGROWTH_TIME) + timerdata.regrowtime,

would solve this issue.

Link to comment
Share on other sites

Mathematical operators have precedence over logic operators, so your code is equivalent to

regrowtime = _internaltimes[k] or (CARROT_REGROWTH_TIME + timerdata.regrowtime),

I assume you intended

regrowtime = (_internaltimes[k] or CARROT_REGROWTH_TIME) + timerdata.regrowtime,

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...