From e6a60ec21066df280b2e6606ad168f81a18ceb8c Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 16 Nov 2020 15:41:39 -0800 Subject: [PATCH] Add single day tolerance to end of appearance period --- .../Encounters/EncounterSlot/GO/EncounterSlotGO.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterSlot/GO/EncounterSlotGO.cs b/PKHeX.Core/Legality/Encounters/EncounterSlot/GO/EncounterSlotGO.cs index fa3589719..181b78679 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterSlot/GO/EncounterSlotGO.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterSlot/GO/EncounterSlotGO.cs @@ -44,11 +44,15 @@ namespace PKHeX.Core public bool IsWithinStartEnd(int stamp) { + // Events are in UTC, but time zones exist (and delayed captures too). + // Allow an extra day past the end date. + const int tolerance = 1; + if (End == 0) return Start <= stamp; if (Start == 0) - return stamp <= End; - return Start <= stamp && stamp <= End; + return stamp <= End + tolerance; + return Start <= stamp && stamp <= End + tolerance; } public static int GetTimeStamp(int y, int m, int d) => (y << 16) | (m << 8) | d;