diff options
author | Kahrl <kahrl@gmx.net> | 2013-06-18 01:18:54 +0200 |
---|---|---|
committer | Kahrl <kahrl@gmx.net> | 2013-06-18 01:18:54 +0200 |
commit | c8ed61b2815e9bc32cacc32d8e3dff8bc315831b (patch) | |
tree | 9ff973b5d6fce929933477ab6ca44fdffb4f54ca /src | |
parent | 816ffa99ba3e11eb5d5c50a21fe019bb657c48d3 (diff) | |
download | minetest-c8ed61b2815e9bc32cacc32d8e3dff8bc315831b.tar.gz minetest-c8ed61b2815e9bc32cacc32d8e3dff8bc315831b.tar.bz2 minetest-c8ed61b2815e9bc32cacc32d8e3dff8bc315831b.zip |
Fix calculation of selected item (for not drawing it) in formspec
The previous code did not work when the list did not start at index 0
of the inventory list (issue #779).
Diffstat (limited to 'src')
-rw-r--r-- | src/guiFormSpecMenu.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 3e0d7fd46..0cc631332 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -698,7 +698,7 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase) bool selected = m_selected_item && m_invmgr->getInventory(m_selected_item->inventoryloc) == inv && m_selected_item->listname == s.listname - && m_selected_item->i == i; + && m_selected_item->i == item_i; bool hovering = rect.isPointInside(m_pointer); if(phase == 0) |