mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-25 08:10:48 -05:00
Fix LGPE local time validation (#4445)
The function `IsTimeValid` checks if the received hour, minute, and second of the Pokémon is below 24, 60, and 60 respectively. For some reason the current code includes a "+1" for each check, which results in some legitimate Pokémon being marked as having an invalid timestamp. Fixed edge cases: - Received on the 23rd hour. - Received on the 59th minute. - Received on the 59th second.
This commit is contained in:
parent
806548a456
commit
b2f962f442
|
|
@ -83,6 +83,6 @@ public static DateOnly GetRandomDateWithin(DateOnly start, DateOnly end, Random
|
|||
|
||||
public static bool IsTimeValid(byte receivedHour, byte receivedMinute, byte receivedSecond)
|
||||
{
|
||||
return (receivedHour + 1u) < 24u && (receivedMinute + 1u) < 60u && (receivedSecond + 1u) < 60u;
|
||||
return receivedHour < 24u && receivedMinute < 60u && receivedSecond < 60u;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user