1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-05-04 00:47:46 +00:00

Fix crash in map editor when encountering empty rows

This commit is contained in:
Joshua Goins 2025-05-01 17:59:31 -04:00
parent b8693effc0
commit d82333ae3e

View file

@ -51,7 +51,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
const uint16_t territoryTypeKey = rows.row_data[0].column_data[15].u_int16._0;
if (territoryTypeKey > 0 && territoryTypeKey < territoryExh->row_count) {
auto territoryExdRow = physis_exd_read_row(&territoryExd, territoryTypeKey); // TODO: free, use all rows
if (territoryExdRow.row_count != 0) {
const char *bg = territoryExdRow.row_data[0].column_data[1].string._0;
int placeRegionKey = territoryExdRow.row_data[0].column_data[3].u_int16._0;
@ -77,6 +77,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
originalModel->insertRow(originalModel->rowCount(), item);
}
}
}
listWidget = new QListView();
listWidget->setModel(searchModel);