mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 15:47:15 -05:00
Simplify contest ribbon deadlock set
Was missing the check & revert step; just fix the logic completely. We should have the contest star ribbon if we've set all the ribbons, otherwise it was already removed.
This commit is contained in:
parent
20dcb8d407
commit
a0c998fdd5
|
|
@ -22,7 +22,7 @@ public static void SetAllValidRibbons(LegalityAnalysis la)
|
|||
|
||||
// Ribbon Deadlock
|
||||
if (la.Entity is IRibbonSetCommon6 c6)
|
||||
InvertDeadlockContest(c6, true, args);
|
||||
InvertDeadlockContest(c6, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -73,14 +73,9 @@ private static void SetAllRibbonState(RibbonVerifierArguments args, bool desired
|
|||
}
|
||||
}
|
||||
|
||||
private static void InvertDeadlockContest(IRibbonSetCommon6 c6, bool desiredState, RibbonVerifierArguments args)
|
||||
private static void InvertDeadlockContest(IRibbonSetCommon6 c6, bool desiredState)
|
||||
{
|
||||
// RibbonContestStar depends on having all contest ribbons, and having RibbonContestStar requires all.
|
||||
// Since the above logic sets individual ribbons, we must try setting this deadlock pair manually.
|
||||
if (c6.RibbonMasterToughness == desiredState || c6.RibbonContestStar == desiredState)
|
||||
return;
|
||||
|
||||
c6.RibbonMasterToughness = c6.RibbonContestStar = desiredState;
|
||||
FixInvalidRibbons(args);
|
||||
if (desiredState)
|
||||
c6.RibbonContestStar = c6.HasAllContestRibbons();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user