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,24 +240,30 @@ 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;
var mate = await ABLoader.LoadMateAsync(mateCode);
if (mate != null)
if (mateCode != Items.CODE_NONE)
{
mate0 = mate;
mate0.parent = pos_Avatar_near;
mate0.gameObject.SetActive(false);
var mate = await ABLoader.LoadMateAsync(mateCode);
if (mate != null)
{
mate0 = mate;
mate0.parent = pos_Avatar_near;
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;
......@@ -3295,4 +3301,4 @@ namespace MDPro3.Duel
#endregion
}
}
\ No newline at end of file
}
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