Moved the character's stats into their own database table

This will allow the to be reused elsewhere, as well as cleaning up big
blocks of code in the manager's source.

BUGFIX: The config's key-value pair overrides now work without requiring a
config file specification.
This commit is contained in:
Kayne Ruse
2014-09-28 03:10:39 +10:00
parent 59e3518dd8
commit bfcf9a1d37
4 changed files with 42 additions and 75 deletions
+5
View File
@@ -41,12 +41,14 @@ void ConfigUtility::Load(std::string fname, int argc, char* argv[]) {
table_t redirectedFile;
table_t cmdLineParams;
char key[256], val[256];
bool redirectUsed = false;
//reading from the command line
for (int i = 1; i < argc; ++i) {
//read from a specified config file
if (!strncmp(argv[i], "-config=", 8)) {
redirectedFile = Read(argv[i] + 8);
redirectUsed = true;
continue;
}
@@ -70,6 +72,9 @@ void ConfigUtility::Load(std::string fname, int argc, char* argv[]) {
}
//finally, construct the final config table
if (!redirectUsed) {
redirectedFile = Read(fname);
}
configMap.insert(cmdLineParams.begin(), cmdLineParams.end());
configMap.insert(redirectedFile.begin(), redirectedFile.end());
}