diff --git a/src/game/input/input_mapper.cpp b/src/game/input/input_mapper.cpp index 3977d56..25dc3ce 100644 --- a/src/game/input/input_mapper.cpp +++ b/src/game/input/input_mapper.cpp @@ -121,8 +121,13 @@ std::shared_ptr InputMapper::getInputIdentity(InputDeviceGroup de // No identity found, create new auto newIdentity = std::make_shared(deviceGroup, gamepadId); - inputIdentities.insert(newIdentity); - newInputIdentities.insert(newIdentity); + + // Only add to newInputIdentities if it is allowed, otherwise it will be discarded when possible anyway + if (allowNewInputIdentities) { + inputIdentities.insert(newIdentity); + newInputIdentities.insert(newIdentity); + } + return newIdentity; } diff --git a/src/game/input/input_mapper.h b/src/game/input/input_mapper.h index c3a8e6a..d865bb8 100644 --- a/src/game/input/input_mapper.h +++ b/src/game/input/input_mapper.h @@ -25,6 +25,8 @@ public: std::set> getInputIdentities(); + bool allowNewInputIdentities = true; + public: std::set> newInputIdentities; std::set> deprecatedInputIdentities;