Fix PBR init

Closes #4534
This commit is contained in:
Kurt 2025-08-05 09:52:03 -05:00
parent 031f7f4e6c
commit ceff28210a
2 changed files with 19 additions and 4 deletions

View File

@ -31,7 +31,11 @@ public sealed class SAV4BR : SaveFile, IBoxDetailName
public int CurrentSlot
{
get => _currentSlot;
set => LoadSlot(_currentSlot = value);
set
{
LoadSlot(value);
_currentSlot = value;
}
}
public SAV4BR() : base(SIZE_SLOT) => ClearBoxes();
@ -244,8 +248,19 @@ public override int PlayedSeconds
public string CurrentOT { get => GetOTName(CurrentSlot); set => SetOTName(CurrentSlot, value); }
// Storage
public override int GetPartyOffset(int slot) => Party + (SIZE_PARTY * slot);
public override int GetBoxOffset(int box) => Box + (SIZE_STORED * box * 30);
public override bool HasBox => true;
public override int GetBoxOffset(int box)
{
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(box, BoxCount);
return 0x978 + (SIZE_STORED * box * 30);
}
public override bool HasParty => true;
public override int GetPartyOffset(int slot)
{
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(slot, 6);
return 0x13A54 + (SIZE_PARTY * slot);
}
public override uint Money
{

View File

@ -409,7 +409,7 @@ public int CaughtCount
public decimal PercentCaught => (decimal)CaughtCount / MaxSpeciesID;
#endregion
public bool HasBox => Box > -1;
public virtual bool HasBox => Box > -1;
public virtual int BoxSlotCount => 30;
public virtual int BoxesUnlocked { get => -1; set { } }
public virtual byte[] BoxFlags { get => []; set { } }