diff --git a/PKHeX.Core/Saves/Substructures/Gen6/Encount6.cs b/PKHeX.Core/Saves/Substructures/Gen6/Encount6.cs index ae84a11aa..d266b19e9 100644 --- a/PKHeX.Core/Saves/Substructures/Gen6/Encount6.cs +++ b/PKHeX.Core/Saves/Substructures/Gen6/Encount6.cs @@ -39,7 +39,7 @@ public Roamer6 Roamer [TypeConverter(typeof(ValueTypeTypeConverter))] public sealed class PokeRadar6(Memory Data) { - public const int SIZE = 2 + (RecordCount * PokeRadarRecord.SIZE); // 0x18 + public const int SIZE = 4 + (RecordCount * PokeRadarRecord.SIZE); // 0x18 private const int MaxCharge = 50; private const int RecordCount = 5; @@ -61,17 +61,17 @@ public sealed class PokeRadar6(Memory Data) private static int GetRecordOffset(int index) { - if ((uint) index >= RecordCount) - throw new ArgumentOutOfRangeException(nameof(index)); - - return 6 + (index * 2); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual((uint)index, RecordCount); + return 4 + (index * 4); } - public PokeRadarRecord Record1 { get => GetRecord(0); set => SetRecord(value, 0); } - public PokeRadarRecord Record2 { get => GetRecord(1); set => SetRecord(value, 1); } - public PokeRadarRecord Record3 { get => GetRecord(2); set => SetRecord(value, 2); } - public PokeRadarRecord Record4 { get => GetRecord(3); set => SetRecord(value, 3); } - public PokeRadarRecord Record5 { get => GetRecord(4); set => SetRecord(value, 4); } + // xy.script.390 + // It’s the record machine that offers details of the Poké Radar research. + public PokeRadarRecord RecordPast1st { get => GetRecord(0); set => SetRecord(value, 0); } + public PokeRadarRecord RecordPast2nd { get => GetRecord(1); set => SetRecord(value, 1); } + public PokeRadarRecord RecordPast3rd { get => GetRecord(2); set => SetRecord(value, 2); } + public PokeRadarRecord RecordTarget { get => GetRecord(3); set => SetRecord(value, 3); } + public PokeRadarRecord RecordLatest { get => GetRecord(4); set => SetRecord(value, 4); } } [TypeConverter(typeof(ValueTypeTypeConverter))]