Пример #1
0
static void ResetConfigs(qbool resetall, qbool read_legacy_configs)
{
#ifndef WITH_FTE_VFS
	FILE *f;
#else
	vfsfile_t *v;
#endif

	ResetVariables(CVAR_SERVERINFO, !resetall);

	DeleteUserAliases();

	DeleteUserVariables();

	ResetBinds();

	ResetPlusCommands();

	ResetTeamplayCommands();

	ResetMiscCommands();

	if (read_legacy_configs)
	{
		Cbuf_AddText ("cl_warncmd 0\n");
		Cbuf_AddText ("exec default.cfg\n");
#ifndef WITH_FTE_VFS
		if (FS_FOpenFile("autoexec.cfg", &f) != -1) {
			Cbuf_AddText ("exec autoexec.cfg\n");
			fclose(f);
		}
#else
		if ((v = FS_OpenVFS("autoexec.cfg", "rb", FS_ANY))) {
			Cbuf_AddText ("exec autoexec.cfg\n");
			VFS_CLOSE(v);
		}
#endif
		Cbuf_AddText ("cl_warncmd 1\n");
	}
}
static void ResetConfigs(qbool resetall, qbool read_legacy_configs)
{
	vfsfile_t *v;

	ResetVariables(CVAR_SERVERINFO, !resetall);
	DeleteUserAliases();
	DeleteUserVariables();
	ResetBinds();
	ResetPlusCommands();
	ResetTeamplayCommands();
	ResetMiscCommands();

	if (read_legacy_configs)
	{
		Cbuf_AddText ("cl_warncmd 0\n");
		if ((v = FS_OpenVFS("autoexec.cfg", "rb", FS_ANY))) {
			Cbuf_AddText ("exec autoexec.cfg\n");
			VFS_CLOSE(v);
		}
		Cbuf_AddText ("cl_warncmd 1\n");
	}
}