summaryrefslogtreecommitdiff
path: root/src/net/eathena/questhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/questhandler.cpp')
-rw-r--r--src/net/eathena/questhandler.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp
index 7eb1734f1..7b857b9b7 100644
--- a/src/net/eathena/questhandler.cpp
+++ b/src/net/eathena/questhandler.cpp
@@ -38,6 +38,7 @@ QuestHandler::QuestHandler() :
static const uint16_t _messages[] =
{
SMSG_QUEST_ADD,
+ SMSG_QUEST_LIST,
0
};
handledMessages = _messages;
@@ -52,6 +53,10 @@ void QuestHandler::handleMessage(Net::MessageIn &msg)
processAddQuest(msg);
break;
+ case SMSG_QUEST_LIST:
+ processAddQuests(msg);
+ break;
+
default:
break;
}
@@ -84,4 +89,22 @@ void QuestHandler::processAddQuest(Net::MessageIn &msg)
}
}
+void QuestHandler::processAddQuests(Net::MessageIn &msg)
+{
+ msg.readInt16("len");
+ const int num = msg.readInt32("quests count");
+ for (int f = 0; f < num; f ++)
+ {
+ const int var = msg.readInt32("quest id");
+ const int val = msg.readUInt8("state");
+ if (questsWindow)
+ questsWindow->updateQuest(var, val);
+ if (skillDialog)
+ skillDialog->updateQuest(var, val);
+ }
+
+ if (questsWindow)
+ questsWindow->rebuild(false);
+}
+
} // namespace TmwAthena