diff --git a/gts/pokemondpds.ashx.cs b/gts/pokemondpds.ashx.cs index 54485a44..a3380bd4 100644 --- a/gts/pokemondpds.ashx.cs +++ b/gts/pokemondpds.ashx.cs @@ -377,7 +377,7 @@ namespace PkmnFoundations.GTS int targetPid = BitConverter.ToInt32(data, 296); GtsRecord4 result = DataAbstract.Instance.GtsDataForUser4(targetPid); - if (result == null) + if (result == null || result.IsExchanged != 0) { // Pokémon is traded (or was never here to begin with) // todo: I only checked this on GenV. Check that this diff --git a/gts/syachi2ds.ashx.cs b/gts/syachi2ds.ashx.cs index adc96c84..ed4bc54e 100644 --- a/gts/syachi2ds.ashx.cs +++ b/gts/syachi2ds.ashx.cs @@ -386,7 +386,7 @@ namespace PkmnFoundations.GTS int targetPid = BitConverter.ToInt32(data, 304); GtsRecord5 result = DataAbstract.Instance.GtsDataForUser5(targetPid); - if (result == null) + if (result == null || result.IsExchanged != 0) { // Pokémon is traded (or was never here to begin with) manager.Remove(session); diff --git a/library/Structures/GtsRecord4.cs b/library/Structures/GtsRecord4.cs index a64ece06..5b03dbb2 100644 --- a/library/Structures/GtsRecord4.cs +++ b/library/Structures/GtsRecord4.cs @@ -159,6 +159,8 @@ namespace PkmnFoundations.Structures public bool CanTrade(GtsRecord4 other) { + if (IsExchanged != 0 || other.IsExchanged != 0) return false; + if (Species != other.RequestedSpecies) return false; if (other.RequestedGender != Genders.Either && Gender != other.RequestedGender) return false; if (!CheckLevels(other.RequestedMinLevel, other.RequestedMaxLevel, Level)) return false; diff --git a/library/Structures/GtsRecord5.cs b/library/Structures/GtsRecord5.cs index 5022b31d..6167330b 100644 --- a/library/Structures/GtsRecord5.cs +++ b/library/Structures/GtsRecord5.cs @@ -173,6 +173,8 @@ namespace PkmnFoundations.Structures public bool CanTrade(GtsRecord5 other) { + if (IsExchanged != 0 || other.IsExchanged != 0) return false; + if (Species != other.RequestedSpecies) return false; if (other.RequestedGender != Genders.Either && Gender != other.RequestedGender) return false; if (!CheckLevels(other.RequestedMinLevel, other.RequestedMaxLevel, Level)) return false;