mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
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:
parent
f583cdd385
commit
6e4908b21e
2 changed files with 2 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue