From 3cbf448cf9ef1d08029bf5344013a0b756f5c7bf Mon Sep 17 00:00:00 2001 From: Eli2 Date: Thu, 7 Jul 2016 15:34:02 +0200 Subject: [PATCH] Make ActionKey constructor explicit, fix bad cast Fixes: bug #795 --- src/core/ArxGame.cpp | 2 +- src/core/Config.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ArxGame.cpp b/src/core/ArxGame.cpp index efb31b81aa..e96ecfe59c 100644 --- a/src/core/ArxGame.cpp +++ b/src/core/ArxGame.cpp @@ -1647,7 +1647,7 @@ void ArxGame::updateInput() { GInput->update(); // Handle double clicks. - const ActionKey & button = config.actions[CONTROLS_CUST_ACTION].key[0]; + const ActionKey & button = config.actions[CONTROLS_CUST_ACTION]; if((button.key[0] != -1 && (button.key[0] & Mouse::ButtonBase) && GInput->getMouseButtonDoubleClick(button.key[0], 300)) || (button.key[1] != -1 && (button.key[1] & Mouse::ButtonBase) diff --git a/src/core/Config.h b/src/core/Config.h index b3a2f87382..39714c33bf 100644 --- a/src/core/Config.h +++ b/src/core/Config.h @@ -88,7 +88,7 @@ enum UIScaleFilter { struct ActionKey { - ActionKey(InputKeyId key_0 = -1, InputKeyId key_1 = -1) { + explicit ActionKey(InputKeyId key_0 = -1, InputKeyId key_1 = -1) { key[0] = key_0; key[1] = key_1; }