summaryrefslogtreecommitdiff
path: root/src/guiTable.cpp
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
committerest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
commit81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (patch)
tree1e9ef1be1b3295a8673d6e4f0bdeb4c2d3a6015f /src/guiTable.cpp
parent8077612dcb48221281e726a60eb97bf73fde462b (diff)
parent231ac33d34dfaaddf292c5f31b1eae43eeefba2d (diff)
downloadminetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.gz
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.bz2
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.zip
Merge 0.4.15 changes into stable-0.4
0.4.15 release!
Diffstat (limited to 'src/guiTable.cpp')
-rw-r--r--src/guiTable.cpp4
1 files changed, 1 insertions, 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;
}