Try to create external/internal directory if it's not available.

Typically it always exists on new phones, but I didn't find any information if it's guaranteed to exist and it's missing on my old phone.
This commit is contained in:
Deve 2018-06-11 22:22:43 +02:00
parent be5b389d94
commit 19736c2a51

View File

@ -60,10 +60,18 @@ void AssetsAndroid::init()
paths.push_back(getenv("SUPERTUXKART_DATADIR"));
if (global_android_app->activity->externalDataPath)
{
m_file_manager->checkAndCreateDirectoryP(
global_android_app->activity->externalDataPath);
paths.push_back(global_android_app->activity->externalDataPath);
}
if (global_android_app->activity->internalDataPath)
{
m_file_manager->checkAndCreateDirectoryP(
global_android_app->activity->internalDataPath);
paths.push_back(global_android_app->activity->internalDataPath);
}
if (getenv("EXTERNAL_STORAGE"))
paths.push_back(getenv("EXTERNAL_STORAGE"));