projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3a95054
)
Allow nothing to be selected from formspec parameters
author
sfan5
<sfan5@live.de>
Sun, 2 Oct 2016 13:44:53 +0000
(15:44 +0200)
committer
sfan5
<sfan5@live.de>
Sun, 2 Oct 2016 13:49:18 +0000
(15:49 +0200)
src/guiTable.cpp
patch
|
blob
|
history
diff --git
a/src/guiTable.cpp
b/src/guiTable.cpp
index 3cc95ce4fcde25bc9fba53900f7680775e2569b5..6b33b8266b5d7d5ea1c1852012f574691555feaa 100644
(file)
--- 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;
}