Fix party pool oob (#8581)
This commit is contained in:
parent
cd856cfc40
commit
fe6f72ec52
@ -167,6 +167,10 @@ static u32 PickMonFromPool(const struct Trainer *trainer, u8 *poolIndexArray, u3
|
||||
// If no mon has been found yet continue looking
|
||||
if (monIndex == POOL_SLOT_DISABLED)
|
||||
monIndex = pickFunctions.OtherFunction(trainer, poolIndexArray, partyIndex, monsCount, battleTypeFlags, rules);
|
||||
// If a mon still hasn't been found, return POOL_SLOT_DISABLED which makes party generation default to regular party generation
|
||||
if (monIndex == POOL_SLOT_DISABLED)
|
||||
return monIndex;
|
||||
|
||||
u32 chosenTags = trainer->party[monIndex].tags;
|
||||
u16 chosenSpecies = trainer->party[monIndex].species;
|
||||
u16 chosenItem = trainer->party[monIndex].heldItem;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user