From eb0e9d5661e28cdd4f59b96f7ab269fbf67bdc34 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 2 Oct 2016 15:44:53 +0200 Subject: [PATCH] Allow nothing to be selected from formspec parameters --- src/guiTable.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/guiTable.cpp b/src/guiTable.cpp index 3cc95ce4f..6b33b8266 100644 --- a/src/guiTable.cpp +++ b/src/guiTable.cpp @@ -565,10 +565,8 @@ void GUITable::setSelected(s32 index) --index; // Switch from 1-based indexing to 0-based indexing s32 rowcount = m_rows.size(); - if (rowcount == 0) { + if (rowcount == 0 || index < 0) { return; - } else if (index < 0) { - index = 0; } else if (index >= rowcount) { index = rowcount - 1; } -- 2.25.1