From 329796d3bad066ed88d05b215c815847ab77ce1c Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Thu, 25 Apr 2024 12:36:43 +0800 Subject: [PATCH] Android: Fix inconsistency issue with t.externalstorage. --- src/modules/filesystem/physfs/Filesystem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 5b5afd0aa..230b64104 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -190,6 +190,11 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath) // These will be re-populated by getFullCommonPath. for (CommonPath p : appCommonPaths) fullPaths[p].clear(); +#ifdef LOVE_ANDROID + // Ensure COMMONPATH_USER_APPDATA is also cleared in Android to ensure + // `t.externalstorage` works as expected. + fullPaths[COMMONPATH_USER_APPDATA].clear(); +#endif // Store the save directory. getFullCommonPath(COMMONPATH_APP_*) uses this. saveIdentity = std::string(ident);