fixed wrong $DATADIR path. Closes #316

This commit is contained in:
oy 2010-12-11 22:48:37 +01:00
parent 3d54cf0585
commit 48cd937234

View file

@ -187,18 +187,20 @@ public:
// 4) check for all default locations // 4) check for all default locations
{ {
const char *aDirs[] = { const char *aDirs[] = {
"/usr/share/teeworlds/data/mapres", "/usr/share/teeworlds/data",
"/usr/share/games/teeworlds/data/mapres", "/usr/share/games/teeworlds/data",
"/usr/local/share/teeworlds/data/mapres", "/usr/local/share/teeworlds/data",
"/usr/local/share/games/teeworlds/data/mapres", "/usr/local/share/games/teeworlds/data",
"/opt/teeworlds/data/mapres" "/opt/teeworlds/data"
}; };
const int DirsCount = sizeof(aDirs) / sizeof(aDirs[0]); const int DirsCount = sizeof(aDirs) / sizeof(aDirs[0]);
int i; int i;
for (i = 0; i < DirsCount; i++) for (i = 0; i < DirsCount; i++)
{ {
if (fs_is_dir(aDirs[i])) char aBuf[128];
str_format(aBuf, sizeof(aBuf), "%s/mapres", aDirs[i]);
if(fs_is_dir(aBuf))
{ {
str_copy(m_aDatadir, aDirs[i], sizeof(m_aDatadir)); str_copy(m_aDatadir, aDirs[i], sizeof(m_aDatadir));
return; return;