diff options
| author | santiagopf | 2015-12-13 02:16:11 -0300 |
|---|---|---|
| committer | santiagopf | 2015-12-13 02:16:11 -0300 |
| commit | 477b174d9de4a199cb59a23881db75ef2f6feecb (patch) | |
| tree | c4225a1fe0dbff09e31e735617369a95fd85e370 /scene/gui/popup_menu.cpp | |
| parent | 01f063e2fea23a7156e2748e0ac3f950008966cc (diff) | |
| parent | 709de124c17988ab05f606c09d0f6414fbbd2ca9 (diff) | |
| download | godot-477b174d9de4a199cb59a23881db75ef2f6feecb.tar.gz godot-477b174d9de4a199cb59a23881db75ef2f6feecb.tar.zst godot-477b174d9de4a199cb59a23881db75ef2f6feecb.zip | |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'scene/gui/popup_menu.cpp')
| -rw-r--r-- | scene/gui/popup_menu.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 25e39c189..9dc03272b 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -370,7 +370,7 @@ void PopupMenu::_input_event(const InputEvent &p_event) { } int over=_get_mouse_over(Point2(m.x,m.y)); - int id = (over<0 || items[over].separator || items[over].disabled)?-1:items[over].ID; + int id = (over<0 || items[over].separator || items[over].disabled)?-1:(items[over].ID>=0?items[over].ID:over); if (id<0) { mouse_over=-1; @@ -753,6 +753,7 @@ int PopupMenu::find_item_by_accelerator(uint32_t p_accel) const { void PopupMenu::activate_item(int p_item) { + ERR_FAIL_INDEX(p_item,items.size()); ERR_FAIL_COND(items[p_item].separator); int id = items[p_item].ID>=0?items[p_item].ID:p_item; |
