From c6492e2ccfa349542050cb48cf2c8476fabf45d3 Mon Sep 17 00:00:00 2001 From: "bartz24games@gmail.com" Date: Fri, 8 Jan 2021 14:15:40 -0500 Subject: [PATCH] Fixed enemy drop plando when the common and rare drops are the same --- FormMain.cs | 2 +- Randomizers/RandoEnemies.cs | 11 ++++++++++- VersionOrder.cs | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/FormMain.cs b/FormMain.cs index fea7c73..da3410c 100644 --- a/FormMain.cs +++ b/FormMain.cs @@ -18,7 +18,7 @@ namespace FF13Randomizer { public partial class FormMain : Form { - public static string Version { get; set; } = "1.8.0"; + public static string Version { get; set; } = "1.8.1"; public static bool PlandoModified { get; set; } = false; diff --git a/Randomizers/RandoEnemies.cs b/Randomizers/RandoEnemies.cs index aa117bf..72db0a0 100644 --- a/Randomizers/RandoEnemies.cs +++ b/Randomizers/RandoEnemies.cs @@ -104,7 +104,7 @@ public override void Randomize(BackgroundWorker backgroundWorker) { RandomizeDrop(e, eID, true, plandoDrops); RandomizeDrop(e, eID, false, plandoDrops); - } while (e.CommonDropID == e.RareDropID && !string.IsNullOrEmpty(e.CommonDropID)); + } while (!AreDropsValid(e, eID, plandoDrops)); RandomNum.ClearRand(); } } @@ -217,6 +217,15 @@ public override void Randomize(BackgroundWorker backgroundWorker) } } + private bool AreDropsValid(DataStoreEnemy e, Enemy eID, Dictionary> plandoDrops) + { + if (plandoDrops.ContainsKey(eID) && plandoDrops[eID].Item1 != null && plandoDrops[eID].Item1 != null) + { + return true; + } + return (e.CommonDropID != e.RareDropID) || (string.IsNullOrEmpty(e.CommonDropID) && string.IsNullOrEmpty(e.RareDropID)); + } + public override void Save() { File.WriteAllBytes($"db\\resident\\bt_chara_spec.wdb", enemies.Data); diff --git a/VersionOrder.cs b/VersionOrder.cs index d427520..247e5c3 100644 --- a/VersionOrder.cs +++ b/VersionOrder.cs @@ -12,6 +12,7 @@ public class VersionOrder "1.8.0.Pre", "1.8.0.Pre-2", "1.8.0.Pre-3", + "1.8.0", FormMain.Version };