diff options
author | Przemysław Grzywacz <nexather@gmail.com> | 2013-05-24 18:55:53 +0200 |
---|---|---|
committer | Przemysław Grzywacz <nexather@gmail.com> | 2013-05-24 18:55:53 +0200 |
commit | 05dc1666dc794ed6aa7f6568b768c652f8922c4e (patch) | |
tree | af83e22418e912e8eb8b2bc6b9595da344f461c1 /src/client.cpp | |
parent | 703cd73c0baa82d5f8ae3a1b390401f17de32f7a (diff) | |
parent | f9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d (diff) | |
download | mana-05dc1666dc794ed6aa7f6568b768c652f8922c4e.tar.gz mana-05dc1666dc794ed6aa7f6568b768c652f8922c4e.tar.bz2 mana-05dc1666dc794ed6aa7f6568b768c652f8922c4e.tar.xz mana-05dc1666dc794ed6aa7f6568b768c652f8922c4e.zip |
Merge remote-tracking branch 'origin/master' into lpc2012 branch
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/client.cpp b/src/client.cpp index 88a2a523..1489a0dc 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -75,6 +75,7 @@ #include "resources/resourcemanager.h" #include "resources/theme.h" #include "resources/userpalette.h" +#include "resources/settingsmanager.h" #include "utils/gettext.h" #include "utils/mkdir.h" @@ -452,13 +453,9 @@ Client::~Client() SDL_RemoveTimer(mSecondsCounterId); // Unload XML databases + SettingsManager::unload(); CharDB::unload(); - hairDB.unload(); - EmoteDB::unload(); delete itemDb; - MonsterDB::unload(); - NPCDB::unload(); - StatusEffect::unload(); // Before config.write() since it writes the shortcuts to the config delete itemShortcut; @@ -758,14 +755,15 @@ int Client::exec() false); } - // Read default paths file 'data/paths.xml' - paths.init("paths.xml", true); - + // TODO remove this as soon as inventoryhandler stops using this event Event::trigger(Event::ClientChannel, Event::LoadingDatabases); // Load XML databases CharDB::load(); - hairDB.load(); + + if (itemDb) + delete itemDb; + switch (Net::getNetworkType()) { case ServerInfo::TMWATHENA: @@ -779,23 +777,10 @@ int Client::exec() itemDb = 0; break; } - if (!itemDb || !itemDb->isLoaded()) - { - // Warn and return to login screen - errorMessage = - _("This server is missing needed world data. " - "Please contact the administrator(s)."); - showOkDialog(_("ItemDB: Error while loading " - ITEMS_DB_FILE "!"), errorMessage, - STATE_CHOOSE_SERVER); - break; - } - MonsterDB::load(); - SpecialDB::load(); - NPCDB::load(); - EmoteDB::load(); - StatusEffect::load(); - Units::loadUnits(); + assert(itemDb); + + // load settings.xml + SettingsManager::load(); ActorSprite::load(); |