[Bug] Fix blocking menu when 6 starter selected (#3333)

* fix bug of block menu when 6 starter

* update comment

* update comment again
This commit is contained in:
Leo Kim 2024-08-04 16:22:31 +09:00 committed by GitHub
parent 0796a9fce8
commit 8b8ac416b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1265,7 +1265,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (button === Button.ACTION) {
if (!this.speciesStarterDexEntry?.caughtAttr) {
error = true;
} else if (this.starterSpecies.length < 6) { // checks to see you have less than 6 pokemon in your party
} else if (this.starterSpecies.length <= 6) { // checks to see if the party has 6 or fewer pokemon
let species;
@ -1291,7 +1291,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
const currentPartyValue = this.starterSpecies.map(s => s.generation).reduce((total: number, gen: number, i: number) => total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0);
const newCost = this.scene.gameData.getSpeciesStarterValue(species.speciesId);
if (!isDupe && isValidForChallenge.value && currentPartyValue + newCost <= this.getValueLimit()) { // this checks to make sure the pokemon doesn't exist in your party, it's valid for the challenge and that it won't go over the cost limit; if it meets all these criteria it will add it to your party
if (!isDupe && isValidForChallenge.value && currentPartyValue + newCost <= this.getValueLimit() && this.starterSpecies.length < 6) { // this checks to make sure the pokemon doesn't exist in your party, it's valid for the challenge and that it won't go over the cost limit; if it meets all these criteria it will add it to your party
options = [
{
label: i18next.t("starterSelectUiHandler:addToParty"),