Skip to content

Commit

Permalink
Fix binary dirs for installed locations on POSIX
Browse files Browse the repository at this point in the history
Also rename them from teeworlds to ddnet
  • Loading branch information
def- committed Sep 1, 2017
1 parent f8b98c6 commit ed59b0f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/engine/shared/storage.cpp
Expand Up @@ -204,25 +204,25 @@ class CStorage : public IStorage
// 4) check for all default locations
{
const char *aDirs[] = {
"/usr/share/teeworlds/data",
"/usr/share/games/teeworlds/data",
"/usr/local/share/teeworlds/data",
"/usr/local/share/games/teeworlds/data",
"/usr/pkg/share/teeworlds/data",
"/usr/pkg/share/games/teeworlds/data",
"/opt/teeworlds/data"
"/usr/share/ddnet",
"/usr/share/games/ddnet",
"/usr/local/share/ddnet",
"/usr/local/share/games/ddnet",
"/usr/pkg/share/ddnet",
"/usr/pkg/share/games/ddnet",
"/opt/ddnet"
};
const int DirsCount = sizeof(aDirs) / sizeof(aDirs[0]);

int i;
for (i = 0; i < DirsCount; i++)
{
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "%s/mapres", aDirs[i]);
str_format(aBuf, sizeof(aBuf), "%s/data/mapres", aDirs[i]);
if(fs_is_dir(aBuf))
{
str_copy(m_aBinarydir, aDirs[i], sizeof(aDirs[i])-5);
str_copy(m_aDatadir, aDirs[i], sizeof(m_aDatadir));
str_copy(m_aBinarydir, aDirs[i], sizeof(m_aDatadir));
str_format(m_aDatadir, sizeof(m_aDatadir), "%s/data", aDirs[i]);
return;
}
}
Expand Down

0 comments on commit ed59b0f

Please sign in to comment.