From 993e746249ea0dddcfc5edcbe9a4e2fb61f839e6 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 13 Sep 2010 14:59:08 -0600 Subject: Fix loading of manaserv's attributes file Reviewed-by: Bertram --- src/client.cpp | 2 ++ src/net/manaserv/generalhandler.cpp | 15 +++++++++------ 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(Net::getGameHandler()); - game->gameLoading(); + int newState = event.getInt("newState"); + + if (newState == STATE_GAME) + { + GameHandler *game = static_cast(Net::getGameHandler()); + game->gameLoading(); + } } - else if (newState == STATE_LOAD_DATA) + else if (event.getName() == "DBsLoading") { Attributes::load(); Attributes::informItemDB(); -- cgit v1.2.3-70-g09d2