mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
Fix tera slot wrapping
Tera slot was wrapping to party length -1, causing the last party member to be excluded from consideration
This commit is contained in:
parent
49edc39bda
commit
78ec3c3438
@ -607,7 +607,7 @@ export class TrainerConfig {
|
||||
const shedinjaCanTera = !this.hasSpecialtyType() || this.specialtyType === Type.BUG; // Better to check one time than 6
|
||||
const partyMemberIndexes = new Array(party.length).fill(null).map((_, i) => i)
|
||||
.filter(i => shedinjaCanTera || party[i].species.speciesId !== Species.SHEDINJA); // Shedinja can only Tera on Bug specialty type (or no specialty type)
|
||||
const setPartySlot = !Utils.isNullOrUndefined(slot) ? Phaser.Math.Wrap(slot, 0, party.length - 1) : -1; // If we have a tera slot defined, wrap it to party size.
|
||||
const setPartySlot = !Utils.isNullOrUndefined(slot) ? Phaser.Math.Wrap(slot, 0, party.length) : -1; // If we have a tera slot defined, wrap it to party size.
|
||||
for (let t = 0; t < Math.min(count(), party.length); t++) {
|
||||
const randomIndex = partyMemberIndexes.indexOf(setPartySlot) > -1 ? setPartySlot : Utils.randSeedItem(partyMemberIndexes);
|
||||
partyMemberIndexes.splice(partyMemberIndexes.indexOf(randomIndex), 1);
|
||||
|
Loading…
Reference in New Issue
Block a user