Tweak set override logic

If the method defines whether or not the sub should be called, that will
be used. Else, it will use the global setting.
This commit is contained in:
Kurt 2015-12-08 06:19:34 -08:00
parent a4b5033b1e
commit dd910e6aa1

View File

@ -467,9 +467,9 @@ public PK6 getPK6Stored(int offset)
}
public void setPK6Party(PK6 pk6, int offset, bool? trade = null, bool? dex = null)
{
if (SetUpdatePK6 || (trade ?? false))
if (trade ?? SetUpdatePK6)
setPK6(pk6);
if (SetUpdateDex || (dex ?? false))
if (dex ?? SetUpdateDex)
setDex(pk6);
byte[] ek6 = encryptArray(pk6.Data);
@ -479,9 +479,9 @@ public void setPK6Party(PK6 pk6, int offset, bool? trade = null, bool? dex = nul
}
public void setPK6Stored(PK6 pk6, int offset, bool? trade = null, bool? dex = null)
{
if (SetUpdatePK6 || (trade ?? false))
if (trade ?? SetUpdatePK6)
setPK6(pk6);
if (SetUpdateDex || (dex ?? false))
if (dex ?? SetUpdateDex)
setDex(pk6);
byte[] ek6 = encryptArray(pk6.Data);
@ -492,9 +492,9 @@ public void setPK6Stored(PK6 pk6, int offset, bool? trade = null, bool? dex = nu
public void setEK6Stored(byte[] ek6, int offset, bool? trade = null, bool? dex = null)
{
PK6 pk6 = new PK6(decryptArray(ek6));
if (SetUpdatePK6 || (trade ?? false))
if (trade ?? SetUpdatePK6)
setPK6(pk6);
if (SetUpdateDex || (dex ?? false))
if (dex ?? SetUpdateDex)
setDex(pk6);
Array.Resize(ref ek6, PK6.SIZE_STORED);