Fix issues when user supplies incorrect number of encounters

This commit is contained in:
GriffinR
2023-11-07 13:03:32 -05:00
parent 6ee76f80d1
commit 49cb69f2b8
3 changed files with 7 additions and 2 deletions

View File

@@ -10,11 +10,10 @@ EncounterTableModel::EncounterTableModel(WildMonInfo info, EncounterFields field
this->resize(this->monInfo.wildPokemon.size(), ColumnType::Count);
this->slotRatios = fields[fieldIndex].encounterRates;
for (int r = 0; r < this->numRows; r++) {
this->groupNames.append(QString());
this->slotPercentages.append(0.0);
this->slotRatios.append(fields[fieldIndex].encounterRates.value(r, 0));
}
if (!this->encounterFields[this->fieldIndex].groups.empty()) {