mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 09:16:41 -05:00
Implement Trade logic when Set
Friendship and Affection are still not modified. This may cause an issue with users who edit mons with their OT as current handler and set friendship to 255, and the program makes the HT with 0 friendship. Can't really code in an alert as it'd be an annoyance for users. Gotta think about it more :)
This commit is contained in:
34
Misc/SAV6.cs
34
Misc/SAV6.cs
@@ -303,27 +303,20 @@ public PK6 getPK6Stored(int offset)
|
||||
public void setPK6Party(PK6 pk6, int offset, bool? trade = null, bool? dex = null)
|
||||
{
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPK6(pk6);
|
||||
if (SetUpdateDex || (dex ?? false))
|
||||
setPokeDex(pk6);
|
||||
setDex(pk6);
|
||||
|
||||
byte[] ek6 = encryptArray(pk6.Data);
|
||||
Array.Resize(ref ek6, PK6.SIZE_PARTY);
|
||||
setData(ek6, offset);
|
||||
}
|
||||
public void setPK6Stored(PK6 pk6, int offset, bool? trade = null, bool? dex = null)
|
||||
{
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPK6(pk6);
|
||||
if (SetUpdateDex || (dex ?? false))
|
||||
setPokeDex(pk6);
|
||||
setDex(pk6);
|
||||
|
||||
byte[] ek6 = encryptArray(pk6.Data);
|
||||
Array.Resize(ref ek6, PK6.SIZE_STORED);
|
||||
@@ -333,20 +326,23 @@ public void setEK6Stored(byte[] ek6, int offset, bool? trade = null, bool? dex =
|
||||
{
|
||||
PK6 pk6 = new PK6(decryptArray(ek6));
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPK6(pk6);
|
||||
if (SetUpdateDex || (dex ?? false))
|
||||
setPokeDex(pk6);
|
||||
setDex(pk6);
|
||||
|
||||
Array.Resize(ref ek6, PK6.SIZE_STORED);
|
||||
setData(ek6, offset);
|
||||
}
|
||||
|
||||
// Meta
|
||||
public void setPokeDex(PK6 pk6)
|
||||
public void setPK6(PK6 pk6)
|
||||
{
|
||||
// Apply to this Save File
|
||||
DateTime Date = DateTime.Now;
|
||||
pk6.Trade(OT, TID, SID, Country, SubRegion, Gender, false, Date.Day, Date.Month, Date.Year);
|
||||
pk6.RefreshChecksum();
|
||||
}
|
||||
public void setDex(PK6 pk6)
|
||||
{
|
||||
if (pk6.Species == 0)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user