From b320739684dbc3bf0fc50bab54a94c1b5295c428 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sun, 16 Aug 2015 02:24:14 +0200 Subject: [PATCH] Avoid sending an action multiple times in a row --- BBGE/ActionMapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BBGE/ActionMapper.cpp b/BBGE/ActionMapper.cpp index c7e3e2d..559fc5d 100644 --- a/BBGE/ActionMapper.cpp +++ b/BBGE/ActionMapper.cpp @@ -127,7 +127,8 @@ void ActionMapper::addAction (int actionID, int k) if (ad) { - ad->buttonList.push_back(k); + if(std::find(ad->buttonList.begin(), ad->buttonList.end(), k) == ad->buttonList.end()) + ad->buttonList.push_back(k); keyDownMap[k] = core->getKeyState(k); } }