mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed wrong $DATADIR path. Closes #316
This commit is contained in:
parent
3d54cf0585
commit
48cd937234
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue