mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
removed no longer needed data-dir override param - mods system should be used instead. Closes #267
This commit is contained in:
parent
0d1178107e
commit
fd3d01ef14
|
@ -508,12 +508,6 @@ void CConsole::ParseArguments(int NumArgs, const char **ppArguments)
|
||||||
// skip silent param
|
// skip silent param
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0)
|
|
||||||
{
|
|
||||||
// skip datadir param
|
|
||||||
++i;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// search arguments for overrides
|
// search arguments for overrides
|
||||||
|
|
|
@ -35,15 +35,6 @@ public:
|
||||||
// get userdir
|
// get userdir
|
||||||
fs_storage_path(pApplicationName, m_aUserdir, sizeof(m_aUserdir));
|
fs_storage_path(pApplicationName, m_aUserdir, sizeof(m_aUserdir));
|
||||||
|
|
||||||
// check for datadir override
|
|
||||||
for(int i = 1; i < NumArgs; i++)
|
|
||||||
{
|
|
||||||
if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0 && NumArgs - i > 1)
|
|
||||||
{
|
|
||||||
str_copy(m_aDatadir, ppArguments[i+1], sizeof(m_aDatadir));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// get datadir
|
// get datadir
|
||||||
FindDatadir(ppArguments[0]);
|
FindDatadir(ppArguments[0]);
|
||||||
|
|
||||||
|
@ -157,35 +148,21 @@ public:
|
||||||
|
|
||||||
void FindDatadir(const char *pArgv0)
|
void FindDatadir(const char *pArgv0)
|
||||||
{
|
{
|
||||||
// 1) use provided data-dir override
|
// 1) use data-dir in PWD if present
|
||||||
if(m_aDatadir[0])
|
|
||||||
{
|
|
||||||
char aBuffer[MAX_PATH_LENGTH];
|
|
||||||
str_format(aBuffer, sizeof(aBuffer), "%s/mapres", m_aDatadir);
|
|
||||||
if(!fs_is_dir(aBuffer))
|
|
||||||
{
|
|
||||||
dbg_msg("storage", "specified data directory '%s' does not exist", m_aDatadir);
|
|
||||||
m_aDatadir[0] = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2) use data-dir in PWD if present
|
|
||||||
if(fs_is_dir("data/mapres"))
|
if(fs_is_dir("data/mapres"))
|
||||||
{
|
{
|
||||||
str_copy(m_aDatadir, "data", sizeof(m_aDatadir));
|
str_copy(m_aDatadir, "data", sizeof(m_aDatadir));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3) use compiled-in data-dir if present
|
// 2) use compiled-in data-dir if present
|
||||||
if(fs_is_dir(DATA_DIR "/mapres"))
|
if(fs_is_dir(DATA_DIR "/mapres"))
|
||||||
{
|
{
|
||||||
str_copy(m_aDatadir, DATA_DIR, sizeof(m_aDatadir));
|
str_copy(m_aDatadir, DATA_DIR, sizeof(m_aDatadir));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4) check for usable path in argv[0]
|
// 3) check for usable path in argv[0]
|
||||||
{
|
{
|
||||||
unsigned int Pos = ~0U;
|
unsigned int Pos = ~0U;
|
||||||
for(unsigned i = 0; pArgv0[i]; i++)
|
for(unsigned i = 0; pArgv0[i]; i++)
|
||||||
|
@ -207,7 +184,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONF_FAMILY_UNIX)
|
#if defined(CONF_FAMILY_UNIX)
|
||||||
// 5) 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/mapres",
|
||||||
|
|
Loading…
Reference in a new issue