The changes to the MinionConfig and BaseMinionConfig class contain static initializers that reference the Db:
public static string[] ATTRIBUTES = BaseMinionConfig.BaseMinionAttributes().Append(new string[] { Db.Get().Attributes.FoodExpectation.Id, Db.Get().Attributes.ToiletEfficiency.Id }); public static string[] AMOUNTS = BaseMinionConfig.BaseMinionAmounts().Append(new string[] { Db.Get().Amounts.Bladder.Id, Db.Get().Amounts.Stamina.Id, Db.Get().Amounts.Calories.Id }); public static AttributeModifier[] TRAITS = BaseMinionConfig.BaseMinionTraits(MinionConfig.MODEL).Append(new AttributeModifier[] { new AttributeModifier(Db.Get().Attributes.FoodExpectation.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.FOOD_QUALITY_EXPECTATION, MinionConfig.NAME, false, false, true), new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.MAX_CALORIES, MinionConfig.NAME, false, false, true), new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.CALORIES_BURNED_PER_SECOND, MinionConfig.NAME, false, false, true), new AttributeModifier(Db.Get().Amounts.Stamina.deltaAttribute.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.STAMINA_USED_PER_SECOND, MinionConfig.NAME, false, false, true), new AttributeModifier(Db.Get().Amounts.Bladder.deltaAttribute.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.BLADDER_INCREASE_PER_SECOND, MinionConfig.NAME, false, false, true), new AttributeModifier(Db.Get().Attributes.ToiletEfficiency.Id, DUPLICANTSTATS.GetStatsFor(MinionConfig.MODEL).BaseStats.TOILET_EFFICIENCY, MinionConfig.NAME, false, false, true) });
Any attempts to use these classes from a mod will thus crash, as all mod classes are indiscriminately loaded before the Db is initialized. MinionConfig is a popular entry point for many mods, and none of these mods will be possible without removing these references. Can this code be refactored to initialize these arrays later, only after the Db is initialized?
Steps to Reproduce
- Make any mod that tries to use MinionConfig
- Mod will fail to load with
-
2
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now