Skip to content

Commit

Permalink
Fix controller on iOS 15+ (#33)
Browse files Browse the repository at this point in the history
* fixed issue with iOS15 controller support

Co-authored-by: Orangepascal <orangepascal@users.noreply.github.com>
  • Loading branch information
MrStahlfelge and orangepascal committed Apr 27, 2023
1 parent 88092dd commit 369c75d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public void invoke(GCGamepad gcGamepad, GCControllerElement gcControllerElement)
});

if (Foundation.getMajorSystemVersion() >= 14) try {
hapticEngine = controller.getHaptics().createEngine(GCHapticsLocality.Default);
hapticEngine.retain();
if (controller.getHaptics()!=null) {
hapticEngine = controller.getHaptics().createEngine(GCHapticsLocality.Default);
hapticEngine.retain();
}
} catch (Throwable t) {
Gdx.app.error("Controllers", "Failed to create haptics engine", t);
}
Expand Down

0 comments on commit 369c75d

Please sign in to comment.