mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Fix challenge min length (#180)
* Fix challenge min length Challenge min length wasn't working when combined with PokemonRule/TeamRule.
This commit is contained in:
@@ -148,7 +148,7 @@ class PokemonRuleSet
|
|||||||
def canRegisterTeam?(team)
|
def canRegisterTeam?(team)
|
||||||
return false if !team || team.length < self.minTeamLength
|
return false if !team || team.length < self.minTeamLength
|
||||||
return false if team.length > self.maxTeamLength
|
return false if team.length > self.maxTeamLength
|
||||||
teamNumber = [self.maxLength, team.length].min
|
teamNumber = self.minTeamLength
|
||||||
team.each do |pkmn|
|
team.each do |pkmn|
|
||||||
return false if !isPokemonValid?(pkmn)
|
return false if !isPokemonValid?(pkmn)
|
||||||
end
|
end
|
||||||
@@ -175,7 +175,7 @@ class PokemonRuleSet
|
|||||||
# team rules and subset rules. Not all Pokemon in the team have to be valid.
|
# team rules and subset rules. Not all Pokemon in the team have to be valid.
|
||||||
def hasValidTeam?(team)
|
def hasValidTeam?(team)
|
||||||
return false if !team || team.length < self.minTeamLength
|
return false if !team || team.length < self.minTeamLength
|
||||||
teamNumber = [self.maxLength, team.length].min
|
teamNumber = self.minTeamLength
|
||||||
validPokemon = []
|
validPokemon = []
|
||||||
team.each do |pkmn|
|
team.each do |pkmn|
|
||||||
validPokemon.push(pkmn) if isPokemonValid?(pkmn)
|
validPokemon.push(pkmn) if isPokemonValid?(pkmn)
|
||||||
|
|||||||
Reference in New Issue
Block a user