git repos / blockattack-game

commit 4dbeef9f

sago007 · 2018-04-14 10:48
4dbeef9f8a7fa824fc17b76b05dc3a084d0e5ee8 patch · browse files
parent bf4572f8d917cf7f036eb746e88ebf140001037f

Prevent the mouse from jumping when returning to the menu from a sub screen.

Changed files

M source/code/MenuSystem.cpp before
diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp index fdac856..a548157 100644 --- a/source/code/MenuSystem.cpp +++ b/source/code/MenuSystem.cpp
@@ -406,7 +406,8 @@ void Menu::Update() {
if (buttons.at(i)->isPopOnRun()) {
running = false;
}
- globalData.mousex = 0;
+ //Quit here to ensure that we do not continue checking buttons after we have done the action.
+ return;
}
}
if (isClicked(exit, globalData.mousex, globalData.mousey)) {