summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorPrzemysław Grzywacz <nexather@gmail.com>2013-05-24 18:55:53 +0200
committerPrzemysław Grzywacz <nexather@gmail.com>2013-05-24 18:55:53 +0200
commit05dc1666dc794ed6aa7f6568b768c652f8922c4e (patch)
treeaf83e22418e912e8eb8b2bc6b9595da344f461c1 /src/client.cpp
parent703cd73c0baa82d5f8ae3a1b390401f17de32f7a (diff)
parentf9cd8a5d6b4460ffcb945979d1e8cd8ebadc9b8d (diff)
downloadmana-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.cpp37
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();