mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Introduce a mechanism to import old configs and use it for cl_antiping*
This commit is contained in:
parent
27ed6d7033
commit
7512cc10d6
|
@ -3315,10 +3315,10 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
pClient->InitInterfaces();
|
||||
|
||||
// execute config file
|
||||
IOHANDLE file = pStorage->OpenFile(CONFIG_FILE, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
if(file)
|
||||
IOHANDLE File = pStorage->OpenFile(CONFIG_FILE, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
if(File)
|
||||
{
|
||||
io_close(file);
|
||||
io_close(File);
|
||||
pConsole->ExecuteFile(CONFIG_FILE);
|
||||
}
|
||||
else // fallback
|
||||
|
@ -3327,10 +3327,10 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
}
|
||||
|
||||
// execute autoexec file
|
||||
file = pStorage->OpenFile(AUTOEXEC_CLIENT_FILE, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
if(file)
|
||||
File = pStorage->OpenFile(AUTOEXEC_CLIENT_FILE, IOFLAG_READ, IStorage::TYPE_ALL);
|
||||
if(File)
|
||||
{
|
||||
io_close(file);
|
||||
io_close(File);
|
||||
pConsole->ExecuteFile(AUTOEXEC_CLIENT_FILE);
|
||||
}
|
||||
else // fallback
|
||||
|
@ -3338,6 +3338,14 @@ int main(int argc, const char **argv) // ignore_convention
|
|||
pConsole->ExecuteFile(AUTOEXEC_FILE);
|
||||
}
|
||||
|
||||
if(g_Config.m_ClConfigVersion < 1)
|
||||
{
|
||||
g_Config.m_ClAntiPingPlayers = 1;
|
||||
g_Config.m_ClAntiPingGrenade = 1;
|
||||
g_Config.m_ClAntiPingWeapons = 1;
|
||||
}
|
||||
g_Config.m_ClConfigVersion = 1;
|
||||
|
||||
// parse the command line arguments
|
||||
if(argc > 1) // ignore_convention
|
||||
pConsole->ParseArguments(argc-1, &argv[1]); // ignore_convention
|
||||
|
|
|
@ -360,6 +360,7 @@ MACRO_CONFIG_INT(InpJoystick, inp_joystick, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT
|
|||
#else
|
||||
MACRO_CONFIG_INT(InpJoystick, inp_joystick, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Try to use a joystick as input")
|
||||
#endif
|
||||
MACRO_CONFIG_INT(ClConfigVersion, cl_config_version, 0, 0, 0, CFGFLAG_CLIENT|CFGFLAG_SAVE, "The config version. Helps newer clients fix bugs with older configs.")
|
||||
|
||||
// demo editor
|
||||
MACRO_CONFIG_INT(ClDemoSliceBegin, cl_demo_slice_begin, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Begin marker for demo slice")
|
||||
|
|
Loading…
Reference in a new issue