Misc update

remove duplicate pb7 method (present in _K6); note that the fixed length
should not be changed to SIZE_STORED
comment out useless assignment
This commit is contained in:
Kurt 2019-01-09 21:11:14 -08:00
parent e08ecb21c1
commit 19f49eb4a7
3 changed files with 3 additions and 11 deletions

View File

@ -242,7 +242,7 @@ private static IEnumerable<EncounterArea> GetAreas2_H(byte[] data, ref int ofs)
head.Add(new EncounterArea
{
Location = (data[ofs++] << 8) | data[ofs++],
Slots = null, // later
//Slots = null, // later
});
headID.Add(data[ofs++]);
}
@ -255,7 +255,7 @@ private static IEnumerable<EncounterArea> GetAreas2_H(byte[] data, ref int ofs)
rock.Add(new EncounterArea
{
Location = (data[ofs++] << 8) | data[ofs++],
Slots = null, // later
//Slots = null, // later
});
rockID.Add(data[ofs++]);
}

View File

@ -42,14 +42,6 @@ public PB7(byte[] decryptedData, string ident = null)
private string GetString(int Offset, int Count) => StringConverter.GetString7(Data, Offset, Count);
private byte[] SetString(string value, int maxLength, bool chinese = false) => StringConverter.SetString7b(value, maxLength, Language, chinese: chinese);
protected override ushort CalculateChecksum()
{
ushort chk = 0;
for (int i = 8; i < 0xE8; i += 2)
chk += BitConverter.ToUInt16(Data, i);
return chk;
}
// Structure
#region Block A
public override uint EncryptionConstant

View File

@ -24,7 +24,7 @@ public abstract class _K6 : PKM
protected override ushort CalculateChecksum()
{
ushort chk = 0;
for (int i = 8; i < 0xE8; i += 2)
for (int i = 8; i < 0xE8; i += 2) // fixed value; pb7 overrides stored size
chk += BitConverter.ToUInt16(Data, i);
return chk;
}