mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #112760 from Benjamin-Dobell/fix/android/gamepad-connect-on-startup
Android: Fix crash when gamepad connects immediately upon app startup
This commit is contained in:
commit
c36e846fb1
1 changed files with 4 additions and 1 deletions
|
|
@ -436,7 +436,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv *env, j
|
|||
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyconnectionchanged(JNIEnv *env, jclass clazz, jint p_device, jboolean p_connected, jstring p_name) {
|
||||
if (os_android) {
|
||||
String name = jstring_to_string(p_name, env);
|
||||
Input::get_singleton()->joy_connection_changed(p_device, p_connected, name);
|
||||
Input *input = Input::get_singleton();
|
||||
if (input) {
|
||||
input->joy_connection_changed(p_device, p_connected, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue