Skip to content

Commit

Permalink
Fixed down key after jump, don't assign mapping to "Mouse" detected a…
Browse files Browse the repository at this point in the history
…s gamepad on Android
  • Loading branch information
deathkiller committed Nov 5, 2023
1 parent c9d715c commit fa1829d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Sources/Jazz2/Actors/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,13 @@ namespace Jazz2::Actors
_suspendTime = 4.0f;

SetState(ActorState::ApplyGravitation, true);
} else if (!_wasDownPressed && _dizzyTime <= 0.0f) {
} else if (_dizzyTime <= 0.0f) {
if (GetState(ActorState::CanJump)) {
if (!_isLifting && std::abs(_speed.X) < std::numeric_limits<float>::epsilon()) {
_wasDownPressed = true;

SetAnimation(AnimState::Crouch);
}
} else if (_playerType != PlayerType::Frog) {
} else if (!_wasDownPressed && _playerType != PlayerType::Frog) {
_wasDownPressed = true;

_controllable = false;
Expand Down
4 changes: 2 additions & 2 deletions Sources/nCine/Input/JoyMapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ namespace nCine
// Never search by name on Android, it can lead to wrong mapping
if (!mapping.isValid) {
const StringView joyNameView = joyName;
// Don't assign Android default mapping to internal NVIDIA Shield devices and WSA devices
if (joyNameView == "virtual-search"_s || joyNameView == "shield-ask-remote"_s || joyNameView == "virtual_keyboard"_s) {
// Don't assign Android default mapping to internal NVIDIA Shield devices, WSA devices and mice (detected as gamepads)
if (joyNameView == "virtual-search"_s || joyNameView == "shield-ask-remote"_s || joyNameView == "virtual_keyboard"_s || joyNameView.contains("Mouse"_s)) {
return false;
}

Expand Down

0 comments on commit fa1829d

Please sign in to comment.