fixed deletion of config files

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2103 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-05-25 10:55:58 +00:00
parent 5e4eef5a2f
commit b85bad3d69
+7 -4
View File
@@ -570,12 +570,15 @@ COMMAND(writecfg, ARG_NONE);
bool deletecfg()
{
if(!delfile("config/saved.cfg") || !delfile("config/init.cfg"))
string configs[] = { "config/saved.cfg", "config/init.cfg" };
bool failure = false;
loopi(sizeof(configs)/sizeof(configs[0]))
{
conoutf("could not delete the configuration");
return false;
const char *file = findfile(path(configs[i], true), "wb");
if(!file) continue;
if(!delfile(file)) failure = true;
}
return true;
return !failure;
}
void identnames(vector<const char *> &names, bool builtinonly)