From cb8d8e19e1360c3fca0b65abf863f81a4f7676ae Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 23 May 2023 20:12:07 +0200 Subject: [PATCH] input fix: clearBindings no borraba completamente el vector de asignaciones --- units/input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/units/input.cpp b/units/input.cpp index 5597f6c..c2158ac 100644 --- a/units/input.cpp +++ b/units/input.cpp @@ -11,11 +11,13 @@ Input::Input(string file, bool verbose) keyBindings_t kb; kb.scancode = 0; kb.active = false; + keyBindings.clear(); keyBindings.resize(INPUT_TOTAL, kb); GameControllerBindings_t gcb; gcb.button = SDL_CONTROLLER_BUTTON_INVALID; gcb.active = false; + gameControllerBindings.clear(); gameControllerBindings.resize(INPUT_TOTAL, gcb); this->verbose = verbose; @@ -359,10 +361,12 @@ void Input::clearBindings() keyBindings_t kb; kb.scancode = 0; kb.active = false; + keyBindings.clear(); keyBindings.resize(INPUT_TOTAL, kb); GameControllerBindings_t gcb; gcb.button = SDL_CONTROLLER_BUTTON_INVALID; gcb.active = false; + gameControllerBindings.clear(); gameControllerBindings.resize(INPUT_TOTAL, gcb); } \ No newline at end of file