summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-04 12:09:48 +0000
committerrubidium <rubidium@openttd.org>2009-01-04 12:09:48 +0000
commit8c33893ffd5cfcaf3d3a8b0cc24cb1f2be7738ef (patch)
treed3a12cdcf86005f3d95049035d7f5f2f33c97ae5 /src
parent702c372744d1fbcd0ef2dbc10c00634c40ababe0 (diff)
downloadopenttd-8c33893ffd5cfcaf3d3a8b0cc24cb1f2be7738ef.tar.xz
(svn r14824) -Fix [FS#1725]: mouse events could be treated twice (illogict)
Diffstat (limited to 'src')
-rw-r--r--src/window.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/window.cpp b/src/window.cpp
index bf79b2b88..cc5e6b700 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1776,13 +1776,6 @@ static int _input_events_this_tick = 0;
*/
static void HandleAutoscroll()
{
- if (_input_events_this_tick != 0) {
- /* HandleAutoscroll is called only once per GameLoop() - so we can clear the counter here */
- _input_events_this_tick = 0;
- /* there were some inputs this tick, don't scroll ??? */
- return;
- }
-
if (_settings_client.gui.autoscroll && _game_mode != GM_MENU && !IsGeneratingWorld()) {
int x = _cursor.pos.x;
int y = _cursor.pos.y;
@@ -2020,6 +2013,15 @@ void HandleMouseEvents()
void InputLoop()
{
HandleKeyScrolling();
+
+ if (_input_events_this_tick != 0) {
+ /* The input loop is called only once per GameLoop() - so we can clear the counter here */
+ _input_events_this_tick = 0;
+ /* there were some inputs this tick, don't scroll ??? */
+ return;
+ }
+
+ /* HandleMouseEvents was already called for this tick */
HandleMouseEvents();
HandleAutoscroll();
}