diff --git a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll index ff63d48..71e8917 100644 Binary files a/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll and b/DunGenPlus/DunGenPlus/DunGenPlus/DunGenPlus.dll differ diff --git a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGenerator.cs b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGenerator.cs index 42cf5d7..43ede05 100644 --- a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGenerator.cs +++ b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGenerator.cs @@ -94,7 +94,10 @@ namespace DunGenPlus.Generation { } public static int GetMainPathIndexFromTile(Tile tile){ - return tileMainPath[tile]; + if (tileMainPath.TryGetValue(tile, out var value)){ + return value; + } + return 0; } public static void AddTileProxy(TileProxy tileProxy, int index) { diff --git a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorGlobalProps.cs b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorGlobalProps.cs index 04f7d1f..39e8561 100644 --- a/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorGlobalProps.cs +++ b/DunGenPlus/DunGenPlus/Generation/DunGenPlusGeneratorGlobalProps.cs @@ -50,7 +50,6 @@ namespace DunGenPlus.Generation { var num = tile.Placement.IsOnMainPath ? globalProp.MainPathWeight : globalProp.BranchPathWeight; num *= globalProp.DepthWeightScale.Evaluate(tile.Placement.NormalizedDepth); gameObjectChanceTable.Weights.Add(new GameObjectChance(globalProp.gameObject, num, 0f, null)); - } } diff --git a/DunGenPlus/DunGenPlus/Patches/DungeonGeneratorPatch.cs b/DunGenPlus/DunGenPlus/Patches/DungeonGeneratorPatch.cs index cbaa900..105a821 100644 --- a/DunGenPlus/DunGenPlus/Patches/DungeonGeneratorPatch.cs +++ b/DunGenPlus/DunGenPlus/Patches/DungeonGeneratorPatch.cs @@ -367,7 +367,6 @@ namespace DunGenPlus.Patches { [HarmonyTranspiler] [HarmonyPatch(typeof(Dungeon), "FromProxy")] public static IEnumerable FromProxyPatch(IEnumerable instructions){ - var endSequence = new InstructionSequenceStandard("Forloop End"); endSequence.AddBasicLocal(OpCodes.Ldloca_S, 1); endSequence.AddBasic(OpCodes.Constrained);