Skip to content

Commit

Permalink
Fixed enemy drop plando when the common and rare drops are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
bartz24games@gmail.com committed Jan 8, 2021
1 parent 3a84acf commit c6492e2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
11 changes: 10 additions & 1 deletion Randomizers/RandoEnemies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -217,6 +217,15 @@ public override void Randomize(BackgroundWorker backgroundWorker)
}
}

private bool AreDropsValid(DataStoreEnemy e, Enemy eID, Dictionary<Enemy, Tuple<Item, Item>> 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);
Expand Down
1 change: 1 addition & 0 deletions VersionOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit c6492e2

Please sign in to comment.