mirror of
https://github.com/redstrate/Novus.git
synced 2025-05-07 10:17:44 +00:00
Fix crash in map editor when encountering empty rows
This commit is contained in:
parent
b8693effc0
commit
d82333ae3e
1 changed files with 20 additions and 19 deletions
|
@ -51,7 +51,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
||||||
const uint16_t territoryTypeKey = rows.row_data[0].column_data[15].u_int16._0;
|
const uint16_t territoryTypeKey = rows.row_data[0].column_data[15].u_int16._0;
|
||||||
if (territoryTypeKey > 0 && territoryTypeKey < territoryExh->row_count) {
|
if (territoryTypeKey > 0 && territoryTypeKey < territoryExh->row_count) {
|
||||||
auto territoryExdRow = physis_exd_read_row(&territoryExd, territoryTypeKey); // TODO: free, use all rows
|
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;
|
const char *bg = territoryExdRow.row_data[0].column_data[1].string._0;
|
||||||
|
|
||||||
int placeRegionKey = territoryExdRow.row_data[0].column_data[3].u_int16._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);
|
originalModel->insertRow(originalModel->rowCount(), item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
listWidget = new QListView();
|
listWidget = new QListView();
|
||||||
listWidget->setModel(searchModel);
|
listWidget->setModel(searchModel);
|
||||||
|
|
Loading…
Add table
Reference in a new issue