Clamp roto rally score to 99_999

https://github.com/kwsch/PKHeX/issues/2639#issuecomment-575863541
This commit is contained in:
Kurt 2020-01-17 21:09:54 -08:00
parent e3cafe5cd6
commit e4e1681e1c

View File

@ -19,11 +19,15 @@ public int TrainerID
set => SAV.SetData(Data, BitConverter.GetBytes(value), 0x1C);
}
public const int RotoRallyScoreMax = 99_999;
public int RotoRallyScore
{
get => BitConverter.ToInt32(Data, 0x28);
set
{
if (value > RotoRallyScoreMax)
value = RotoRallyScoreMax;
var data = BitConverter.GetBytes(value);
SAV.SetData(Data, data, 0x28);
// set to the other block since it doesn't have an accessor