summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-09-13 14:59:08 -0600
committerJared Adams <jaxad0127@gmail.com>2010-09-13 15:06:59 -0600
commit993e746249ea0dddcfc5edcbe9a4e2fb61f839e6 (patch)
treec0bab2438a3fbe41155b4d8932f17dbba30d8b3c
parent3483d51f703bc2ce2ebf71335225bb6e8c9db99c (diff)
downloadmana-993e746249ea0dddcfc5edcbe9a4e2fb61f839e6.tar.gz
mana-993e746249ea0dddcfc5edcbe9a4e2fb61f839e6.tar.bz2
mana-993e746249ea0dddcfc5edcbe9a4e2fb61f839e6.tar.xz
mana-993e746249ea0dddcfc5edcbe9a4e2fb61f839e6.zip
Fix loading of manaserv's attributes file
Reviewed-by: Bertram
-rw-r--r--src/client.cpp2
-rw-r--r--src/net/manaserv/generalhandler.cpp15
2 files changed, 11 insertions, 6 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 6ed208c0..7ec5a155 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -747,6 +747,8 @@ int Client::exec()
paths.init("paths.xml", true);
paths.setDefaultValues(getPathsDefaults());
+ Mana::Event::trigger("Client", "DBsLoading");
+
// Load XML databases
ColorDB::load();
itemDb = new ItemDB;
diff --git a/src/net/manaserv/generalhandler.cpp b/src/net/manaserv/generalhandler.cpp
index f4982173..2858d16f 100644
--- a/src/net/manaserv/generalhandler.cpp
+++ b/src/net/manaserv/generalhandler.cpp
@@ -176,14 +176,17 @@ void GeneralHandler::event(const std::string &channel,
{
if (channel == "Client")
{
- int newState = event.getInt("newState");
-
- if (newState == STATE_GAME)
+ if (event.getName() == "StatChange")
{
- GameHandler *game = static_cast<GameHandler*>(Net::getGameHandler());
- game->gameLoading();
+ int newState = event.getInt("newState");
+
+ if (newState == STATE_GAME)
+ {
+ GameHandler *game = static_cast<GameHandler*>(Net::getGameHandler());
+ game->gameLoading();
+ }
}
- else if (newState == STATE_LOAD_DATA)
+ else if (event.getName() == "DBsLoading")
{
Attributes::load();
Attributes::informItemDB();