Skip to content

Commit

Permalink
Fix loading units into the first transport on tile
Browse files Browse the repository at this point in the history
Closes #1835.

(cherry picked from commit 551be67)
  • Loading branch information
lmoureaux committed Mar 4, 2023
1 parent f2f268a commit f0229f9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions client/hudwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,8 @@ void unit_actions::clear_layout()
*/
hud_unit_loader::hud_unit_loader(struct unit *pcargo, struct tile *ptile)
{
setProperty("showGrid", "false");
setProperty("selectionBehavior", "SelectRows");
setShowGrid(false);
setSelectionBehavior(QAbstractItemView::SelectRows);
setEditTriggers(QAbstractItemView::NoEditTriggers);
setSelectionMode(QAbstractItemView::SingleSelection);
verticalHeader()->setVisible(false);
Expand Down Expand Up @@ -1255,10 +1255,8 @@ void hud_unit_loader::show_me()
void hud_unit_loader::selection_changed(const QItemSelection &s1,
const QItemSelection &s2)
{
int curr_row;

curr_row = s1.indexes().at(0).row();
if (curr_row > 0 && curr_row < transports.size()) {
auto curr_row = s1.indexes().at(0).row();
if (curr_row >= 0 && curr_row < transports.size()) {
request_unit_load(cargo, transports[curr_row], qtile);
}
close();
Expand Down

0 comments on commit f0229f9

Please sign in to comment.