mirror of https://github.com/OpenTTD/OpenTTD
(svn r14824) -Fix [FS#1725]: mouse events could be treated twice (illogict)
parent
702c372744
commit
8c33893ffd
|
@ -1776,13 +1776,6 @@ static int _input_events_this_tick = 0;
|
||||||
*/
|
*/
|
||||||
static void HandleAutoscroll()
|
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()) {
|
if (_settings_client.gui.autoscroll && _game_mode != GM_MENU && !IsGeneratingWorld()) {
|
||||||
int x = _cursor.pos.x;
|
int x = _cursor.pos.x;
|
||||||
int y = _cursor.pos.y;
|
int y = _cursor.pos.y;
|
||||||
|
@ -2020,6 +2013,15 @@ void HandleMouseEvents()
|
||||||
void InputLoop()
|
void InputLoop()
|
||||||
{
|
{
|
||||||
HandleKeyScrolling();
|
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();
|
HandleMouseEvents();
|
||||||
HandleAutoscroll();
|
HandleAutoscroll();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue