Handle overflow case

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
This commit is contained in:
Kurt 2020-10-12 14:37:08 -07:00
parent a71940bf75
commit 7b6f30b779

View file

@ -103,10 +103,10 @@ namespace PKHeX.Core
public uint CalculateTotalTransferred() public uint CalculateTotalTransferred()
{ {
uint total = 0; ulong total = 0;
for (int i = 0; i < ENTRY_COUNT; i++) for (int i = 0; i < ENTRY_COUNT; i++)
total += GetTransferredCountIndex(i); total += GetTransferredCountIndex(i);
return Math.Min(total, MAX_COUNT_TOTAL); return (uint)Math.Min(total, MAX_COUNT_TOTAL);
} }
public void SetAllCaptured(uint count = MAX_COUNT_ENTRY_CAPTURE, Zukan7b? dex = null) public void SetAllCaptured(uint count = MAX_COUNT_ENTRY_CAPTURE, Zukan7b? dex = null)