Got rid of rules global (ugh) and gonna start work on items loading next

This commit is contained in:
KimLS
2013-02-20 15:35:46 -08:00
parent 8eb7d0aaa8
commit ef9498b03a
15 changed files with 67 additions and 284 deletions
+2 -4
View File
@@ -49,8 +49,6 @@ Database database;
string WorldShortName;
RuleManager *rules = new RuleManager();
const ucsconfig *Config;
WorldServer *worldserver = 0;
@@ -114,11 +112,11 @@ int main() {
if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) {
_log(WORLD__INIT, "Loading rule set '%s'", tmp);
if(!rules->LoadRules(&database, tmp)) {
if(!RuleManager::Instance()->LoadRules(&database, tmp)) {
_log(UCS__ERROR, "Failed to load ruleset '%s', falling back to defaults.", tmp);
}
} else {
if(!rules->LoadRules(&database, "default")) {
if(!RuleManager::Instance()->LoadRules(&database, "default")) {
_log(UCS__INIT, "No rule set configured, using default rules");
} else {
_log(UCS__INIT, "Loaded default rule set 'default'", tmp);