Commit 236be64a authored by ElderLich's avatar ElderLich

Mate selection breaks when Player 1 is set to No Image

If your mate is set to No Image and the opponent mate is set (for example Ruby Carbuncle), starting a duel shows Rescue Rabbit on your side and no mate on the opponent side. Expected behavior is: your side has no mate, opponent shows the selected mate.
parent 2788ed36
......@@ -240,11 +240,16 @@ namespace MDPro3.Duel
#region Mate
var mateConfig = Config.Get(condition.ToString() + "Mate0", Program.items.mates[0].id.ToString());
if (mateConfig != Items.CODE_NONE.ToString() || deck != null)
var overrideDeckAppearance = Config.GetBool("OverrideDeckAppearance", false);
var mateConfigIsNone = mateConfig == Items.CODE_NONE.ToString();
if (!mateConfigIsNone || (deck != null && !overrideDeckAppearance))
{
int mateCode = int.Parse(mateConfig);
if (deck != null && !Config.GetBool("OverrideDeckAppearance", false))
if (deck != null && !overrideDeckAppearance && !mateConfigIsNone)
mateCode = deck.Mate;
if (mateCode != Items.CODE_NONE)
{
var mate = await ABLoader.LoadMateAsync(mateCode);
if (mate != null)
{
......@@ -253,11 +258,12 @@ namespace MDPro3.Duel
mate0.gameObject.SetActive(false);
}
}
}
mateConfig = Config.Get(condition.ToString() + "Mate1", Program.items.mates[0].id.ToString());
if (mateConfig != Items.CODE_NONE.ToString())
{
var mate = await ABLoader.LoadMateAsync(int.Parse(Config.Get(condition.ToString() + "Mate1", Program.items.mates[0].id.ToString())));
var mate = await ABLoader.LoadMateAsync(int.Parse(mateConfig));
if (mate != null)
{
mate1 = mate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment