Simplify a little

path.getfilename will never return null unless you pass null, which we don't do

setchecksums' base method does the AllBlocks.SetChecksums. move the battle team set to right before the usage of SetChecksums
This commit is contained in:
Kurt 2021-02-13 01:38:09 -08:00
parent f583cdd385
commit 6e4908b21e
2 changed files with 2 additions and 9 deletions

View file

@ -93,14 +93,9 @@ namespace PKHeX.Core
new byte[0x80].CopyTo(Data, AllBlocks[MemeCryptoBlock].Offset + 0x100);
}
protected override void SetChecksums()
{
BoxLayout.SaveBattleTeams();
AllBlocks.SetChecksums(Data);
}
protected override byte[] GetFinalData()
{
BoxLayout.SaveBattleTeams();
SetChecksums();
var result = MemeCrypto.Resign7(Data);
Debug.Assert(result != Data);

View file

@ -94,12 +94,10 @@ namespace PKHeX.Core
FileName = GetFileName(path, BAKSuffix);
}
private static string? GetFileName(string path, string bak)
private static string GetFileName(string path, string bak)
{
var bakName = Util.CleanFileName(bak);
var fn = Path.GetFileName(path);
if (fn == null)
return null;
return fn.EndsWith(bakName) ? fn.Substring(0, fn.Length - bakName.Length) : fn;
}