mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 10:14:43 -05:00
Misc tweaks
Re-dump safari slots for HGSS; the repackaged narc accidentally shuffled files so the wrong water tables were output. Add error log output on reporting exception fail first to always dump an error log file. Don't trust the popup/form. Permit TID/OT duplication for in-game trades/N's pokemon. https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=287395
This commit is contained in:
@@ -49,9 +49,7 @@ private static void Verify(BulkAnalysis input, Dictionary<uint, CombinedReferenc
|
||||
|
||||
private static bool VerifyIDReuse(BulkAnalysis input, SlotCache ps, LegalityAnalysis pa, SlotCache cs, LegalityAnalysis ca)
|
||||
{
|
||||
if (pa.EncounterMatch is MysteryGift { EggEncounter: false })
|
||||
return false;
|
||||
if (ca.EncounterMatch is MysteryGift { EggEncounter: false })
|
||||
if (IsNotPlayerDetails(pa.EncounterMatch) || IsNotPlayerDetails(ca.EncounterMatch))
|
||||
return false;
|
||||
|
||||
const CheckIdentifier ident = Trainer;
|
||||
@@ -77,6 +75,13 @@ private static bool VerifyIDReuse(BulkAnalysis input, SlotCache ps, LegalityAnal
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsNotPlayerDetails(IEncounterTemplate enc) => enc switch
|
||||
{
|
||||
IFixedTrainer { IsFixedTrainer: true } => true,
|
||||
MysteryGift { IsEgg: false } => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
private static bool IsSharedVersion(PKM pp, LegalityAnalysis pa, PKM cp, LegalityAnalysis ca)
|
||||
{
|
||||
if (pp.Version == cp.Version || pp.Version == 0 || cp.Version == 0)
|
||||
@@ -95,6 +100,7 @@ private static bool IsSharedVersion(PKM pp, LegalityAnalysis pa, PKM cp, Legalit
|
||||
|
||||
static bool IsTradedEggVersionNoUpdate(PKM pk, LegalityAnalysis la) => la.Info.Generation switch
|
||||
{
|
||||
2 => true, // No version stored, just ignore.
|
||||
3 => true, // No egg location, assume can be traded. Doesn't update version upon hatch.
|
||||
4 => pk.WasTradedEgg, // Gen4 traded eggs do not update version upon hatch.
|
||||
_ => false, // Gen5+ eggs have an egg location, and update the version upon hatch.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -108,6 +108,14 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc
|
||||
|
||||
private static void HandleReportingException(Exception? ex, Exception reportingException)
|
||||
{
|
||||
try
|
||||
{
|
||||
EmergencyErrorLog(ex, reportingException);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// We've failed to even save the error details to a file. There's nothing else we can do.
|
||||
}
|
||||
if (reportingException is FileNotFoundException x && x.FileName?.StartsWith("PKHeX.Core") == true)
|
||||
{
|
||||
Error("Could not locate PKHeX.Core.dll. Make sure you're running PKHeX together with its code library. Usually caused when all files are not extracted.");
|
||||
@@ -116,7 +124,6 @@ private static void HandleReportingException(Exception? ex, Exception reportingE
|
||||
try
|
||||
{
|
||||
Error("A fatal non-UI error has occurred in PKHeX, and there was a problem displaying the details. Please report this to the author.");
|
||||
EmergencyErrorLog(ex, reportingException);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user