]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Menu/Menu.cpp
Fixes #41 It was hard to click on the next campaign level when it’s above an old one
[lugaru.git] / Source / Menu / Menu.cpp
index 7d8bce8dfdac5b83c44ff0aa1784c0f8f93c2961..1ce296024ac0dc8af26e6ad0a34a1ceeceb39abd 100644 (file)
@@ -141,7 +141,7 @@ void Menu::setText(int id, const string& text, int x, int y, int w, int h)
 
 int Menu::getSelected(int mousex, int mousey)
 {
-    for (vector<MenuItem>::iterator it = items.begin(); it != items.end(); it++)
+    for (vector<MenuItem>::reverse_iterator it = items.rbegin(); it != items.rend(); it++)
         if (it->type == MenuItem::BUTTON || it->type == MenuItem::IMAGEBUTTON || it->type == MenuItem::MAPMARKER) {
             int mx = mousex;
             int my = mousey;