Ver Fonte

Fix rewards bug

nordsoft há 3 anos atrás
pai
commit
cd28a0791b
1 ficheiros alterados com 6 adições e 2 exclusões
  1. 6 2
      mapeditor/inspector/rewardswidget.cpp

+ 6 - 2
mapeditor/inspector/rewardswidget.cpp

@@ -346,8 +346,12 @@ void RewardsWidget::on_buttonAdd_clicked()
 
 void RewardsWidget::on_buttonRemove_clicked()
 {
-	ui->rewardsTable->removeRow(ui->rewardsTable->currentRow());
-	--rewards;
+	auto currentRow = ui->rewardsTable->currentRow();
+	if(currentRow != -1)
+	{
+		ui->rewardsTable->removeRow(currentRow);
+		--rewards;
+	}
 }