mirror of
https://github.com/mm201/pkmn-classic-framework.git
synced 2026-08-26 04:04:12 -05:00
Fixed a race condition allowing one Pokémon to go to two people.
(And the first offer gets overwritten.)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user