From 281f9a9f88a8da7685c80ecbaf64991561522f3e Mon Sep 17 00:00:00 2001 From: Muhammad Rifqi Priyo Susanto Date: Wed, 30 Nov 2022 22:50:06 +0700 Subject: Android: Segmentation fault fix, PendingIntent flag, and other fixes (#12960) * Android: Segmentation fault fix, PendingIntent flag, and other fixes - Information about the crosshair is sent after camera initialization. - Since API 31, PendingIntent requires mutability flag. - super (class) is called in onRequestPermissionsResult(). - GameActivity suppresses "unused" warning since most of its methods are called from native code. - Non-null safety is added for nullable function calls. - Warning/error logging is added for various function calls' return value. * Move utility functions into Utils.java - Some nullable functions are changed to be non-null functions. - Some null checking outside it is removed. - More annotations are added to functions and parameters. --- src/client/game.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/game.cpp b/src/client/game.cpp index 179557cf5..e180c88b2 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1421,7 +1421,6 @@ bool Game::createClient(const GameStartData &start_data) if (g_touchscreengui) { g_touchscreengui->init(texture_src); g_touchscreengui->hide(); - g_touchscreengui->setUseCrosshair(!isNoCrosshairAllowed()); } #endif if (!connectToServer(start_data, &could_connect, &connect_aborted)) @@ -1458,6 +1457,11 @@ bool Game::createClient(const GameStartData &start_data) if (client->modsLoaded()) client->getScript()->on_camera_ready(camera); client->setCamera(camera); +#ifdef HAVE_TOUCHSCREENGUI + if (g_touchscreengui) { + g_touchscreengui->setUseCrosshair(!isNoCrosshairAllowed()); + } +#endif /* Clouds */ -- cgit v1.2.3