move jdownloader
[ub0rlay.git] / games-arcade / teeworlds / files / fix_datadir_search.patch
Commit [+]AuthorDateLineData
c732301f
FB
Felix Bechstein2009-03-25 16:44:45 +01001diff -r 9582fcee983b -r c1502459a920 src/engine/e_engine.c
2--- a/src/engine/e_engine.c Sun Feb 01 20:50:22 2009 +0100
3+++ b/src/engine/e_engine.c Sun Feb 01 21:37:17 2009 +0100
4@@ -539,14 +539,15 @@
5 }
6
7 /* 2) use data-dir in PWD if present */
8- if(fs_is_dir("data"))
9+ /* test subdir "/mapres" to reject unrelated "data" dir in PWD */
10+ if(fs_is_dir("data/mapres"))
11 {
12 strcpy(datadir, "data");
13 return 0;
14 }
15
16 /* 3) use compiled-in data-dir if present */
17- if (fs_is_dir(DATA_DIR))
18+ if (fs_is_dir(DATA_DIR "/mapres"))
19 {
20 strcpy(datadir, DATA_DIR);
21 return 0;
22@@ -572,9 +573,11 @@
23 /* 5) check for all default locations */
24 {
25 const char *sdirs[] = {
26- "/usr/share/teeworlds",
27- "/usr/local/share/teeworlds"
28- "/opt/teeworlds"
29+ "/usr/share/teeworlds/data",
30+ "/usr/share/games/teeworlds/data",
31+ "/usr/local/share/teeworlds/data",
32+ "/usr/local/share/games/teeworlds/data",
33+ "/opt/teeworlds/data"
34 };
35 const int sdirs_count = sizeof(sdirs) / sizeof(sdirs[0]);
36