Adding any new vege manually through resources, or through LDB tool, the game errors during loading in PlanetModelingManager.PrepareWorks with an IndexOutOfRangeException.
Error does not occur until attempting to load into a world.
Simpliest possible code to replicate using LDB tool below.
namespace Vegetal {
[BepInPlugin("org.bepinex.plugins.vegetal", "Uh oh, you just got beaned", "1.0.0")]
public class Vegetal : BaseUnityPlugin {
void Start() {
LDBTool.PostAddDataAction += Veges;
Harmony.CreateAndPatchAll(typeof(Vegetal));
}
void Veges() {
VegeProto vege126 = LDB.veges.Select(126);
VegeProto newVege = vege126.Copy();
newVege.ID = 3999; // 3999 is not in use
newVege.name = "TestVege";
LDBTool.PostAddProto(ProtoType.Vege, newVege);
}
}
}
Adding any new vege manually through resources, or through LDB tool, the game errors during loading in PlanetModelingManager.PrepareWorks with an IndexOutOfRangeException.
Error does not occur until attempting to load into a world.
Simpliest possible code to replicate using LDB tool below.