mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:10:49 +02:00
fix crash for NULL deviceProxy
This commit is contained in:
parent
61f6139f4f
commit
00bea4d274
1 changed files with 3 additions and 3 deletions
|
@ -90,7 +90,7 @@ void UserInputMapper::update(float deltaTime) {
|
||||||
bool isActiveModifier = false;
|
bool isActiveModifier = false;
|
||||||
for (auto& modifier : modifiersIt->second) {
|
for (auto& modifier : modifiersIt->second) {
|
||||||
auto deviceProxy = getDeviceProxy(modifier);
|
auto deviceProxy = getDeviceProxy(modifier);
|
||||||
if (deviceProxy->getButton(modifier, currentTimestamp)) {
|
if (deviceProxy && deviceProxy->getButton(modifier, currentTimestamp)) {
|
||||||
validModifiers.push_back(modifier);
|
validModifiers.push_back(modifier);
|
||||||
isActiveModifier |= (modifier.getID() == inputMapping._modifier.getID());
|
isActiveModifier |= (modifier.getID() == inputMapping._modifier.getID());
|
||||||
}
|
}
|
||||||
|
@ -99,8 +99,8 @@ void UserInputMapper::update(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if enabled: default input or all modifiers on
|
// if enabled: default input or all modifiers on
|
||||||
if (enabled) {
|
auto deviceProxy = getDeviceProxy(inputID);
|
||||||
auto deviceProxy = getDeviceProxy(inputID);
|
if (enabled && deviceProxy) {
|
||||||
switch (inputMapping._input.getType()) {
|
switch (inputMapping._input.getType()) {
|
||||||
case ChannelType::BUTTON: {
|
case ChannelType::BUTTON: {
|
||||||
_actionStates[channelInput.first] += inputMapping._scale * float(deviceProxy->getButton(inputID, currentTimestamp));// * deltaTime; // weight the impulse by the deltaTime
|
_actionStates[channelInput.first] += inputMapping._scale * float(deviceProxy->getButton(inputID, currentTimestamp));// * deltaTime; // weight the impulse by the deltaTime
|
||||||
|
|
Loading…
Reference in a new issue