1diff -ru3 0ad-0.0.20-alpha/source/ps/GameSetup/Paths.cpp 0ad-0.0.20-alpha-new/source/ps/GameSetup/Paths.cpp
2--- 0ad-0.0.20-alpha/source/ps/GameSetup/Paths.cpp 2015-02-14 04:45:13.000000000 +0300
3+++ 0ad-0.0.20-alpha-new/source/ps/GameSetup/Paths.cpp 2016-11-03 16:23:47.241514876 +0300
4@@ -155,32 +155,8 @@
5
6 /*static*/ OsPath Paths::Root(const OsPath& argv0)
7 {
8-#if OS_ANDROID
9- return OsPath("/sdcard/0ad"); // TODO: this is kind of bogus
10-#else
11-
12- // get full path to executable
13- OsPath pathname = sys_ExecutablePathname(); // safe, but requires OS-specific implementation
14- if(pathname.empty()) // failed, use argv[0] instead
15- {
16- errno = 0;
17- pathname = wrealpath(argv0);
18- if(pathname.empty())
19- WARN_IF_ERR(StatusFromErrno());
20- }
21-
22- // make sure it's valid
23- if(!FileExists(pathname))
24- {
25- LOGERROR("Cannot find executable (expected at '%s')", pathname.string8());
26- WARN_IF_ERR(StatusFromErrno());
27- }
28-
29- for(size_t i = 0; i < 2; i++) // remove "system/name.exe"
30- pathname = pathname.Parent();
31- return pathname;
32-
33-#endif
34+ UNUSED2(argv0);
35+ return getenv("ZEROAD_ROOTDIR");
36 }
37
38 /*static*/ OsPath Paths::RootData(const OsPath& argv0)