repoint sav4 event constant reads

should work fine now
This commit is contained in:
Kurt
2019-12-27 18:30:39 -08:00
parent 940cdccb6b
commit f65e0a96a7

View File

@@ -954,6 +954,32 @@ public override byte[] SetString(string value, int maxLength, int PadToSize = 0,
return StringConverter4.SetString4(value, maxLength, PadToSize, PadWith);
}
/// <summary> All Event Constant values for the savegame </summary>
public override ushort[] EventConsts
{
get
{
if (EventConstMax <= 0)
return Array.Empty<ushort>();
ushort[] Constants = new ushort[EventConstMax];
for (int i = 0; i < Constants.Length; i++)
Constants[i] = BitConverter.ToUInt16(General, EventConst + (i * 2));
return Constants;
}
set
{
if (EventConstMax <= 0)
return;
if (value.Length != EventConstMax)
return;
for (int i = 0; i < value.Length; i++)
BitConverter.GetBytes(value[i]).CopyTo(General, EventConst + (i * 2));
}
}
// Seals
private const byte SealMaxCount = 99;
public byte[] SealCase { get => General.Slice(Seal, (int) Seal4.MAX); set => SetData(General, value, Seal); }