Fixed a race condition allowing one Pokémon to go to two people.

(And the first offer gets overwritten.)
This commit is contained in:
Greg Edwards
2014-05-18 16:18:54 -04:00
parent 6d2cdf81d8
commit 123e665c7e
4 changed files with 6 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;