Skip to content

Commit

Permalink
Fix to "look" input code so it correctly uses joystick input from the…
Browse files Browse the repository at this point in the history
… gamepad selected in controller settings (XProger#327)
  • Loading branch information
FluffyQuack authored Feb 26, 2021
1 parent 25df2d8 commit b4b19f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ struct Camera : ICamera {
if (mode == MODE_LOOK) {
float d = 3.0f * Core::deltaTime;

vec2 L = Input::joy[cameraIndex].L;
vec2 L = Input::joy[Core::settings.controls[cameraIndex].joyIndex].L;
L = L.normal() * max(0.0f, L.length() - INPUT_JOY_DZ_STICK) / (1.0f - INPUT_JOY_DZ_STICK);

lookAngle.x += L.y * d;
Expand Down

0 comments on commit b4b19f2

Please sign in to comment.