summaryrefslogtreecommitdiffstats
path: root/src/game-server/quest.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-27 08:11:49 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-27 08:11:49 +0000
commite0921ef6a874d81c569e46ae58fee3e6a4567902 (patch)
tree39616279d580b962964540f7057bf36fc467b419 /src/game-server/quest.cpp
parent9c99307af34ade061b1d4ac75ab39b3af510dc24 (diff)
downloadmanaserv-e0921ef6a874d81c569e46ae58fee3e6a4567902.tar.gz
manaserv-e0921ef6a874d81c569e46ae58fee3e6a4567902.tar.xz
manaserv-e0921ef6a874d81c569e46ae58fee3e6a4567902.zip
Made it compile with GCC 4.3
Diffstat (limited to 'src/game-server/quest.cpp')
-rw-r--r--src/game-server/quest.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/game-server/quest.cpp b/src/game-server/quest.cpp
index 4b93407..512bf39 100644
--- a/src/game-server/quest.cpp
+++ b/src/game-server/quest.cpp
@@ -81,26 +81,9 @@ void setQuestVar(Character *ch, std::string const &name,
*/
struct QuestDeathListener: EventDispatch
{
- static void partialRemove(EventListener const *, Thing *t)
- {
- int id = static_cast< Character * >(t)->getDatabaseID();
- PendingVariables &variables = pendingQuests[id].variables;
- // Remove all the callbacks, but do not remove the variable names.
- for (PendingVariables::iterator i = variables.begin(),
- i_end = variables.end(); i != i_end; ++i)
- {
- i->second.clear();
- }
- // The listener is kept in case a fullRemove is needed later.
- }
+ static void partialRemove(EventListener const *, Thing *);
- static void fullRemove(EventListener const *, Character *ch)
- {
- extern EventListener questDeathListener;
- ch->removeListener(&questDeathListener);
- // Remove anything related to this character.
- pendingQuests.erase(ch->getDatabaseID());
- }
+ static void fullRemove(EventListener const *, Character *);
QuestDeathListener()
{
@@ -112,6 +95,26 @@ struct QuestDeathListener: EventDispatch
static QuestDeathListener questDeathDummy;
static EventListener questDeathListener(&questDeathDummy);
+void QuestDeathListener::partialRemove(EventListener const *, Thing *t)
+{
+ int id = static_cast< Character * >(t)->getDatabaseID();
+ PendingVariables &variables = pendingQuests[id].variables;
+ // Remove all the callbacks, but do not remove the variable names.
+ for (PendingVariables::iterator i = variables.begin(),
+ i_end = variables.end(); i != i_end; ++i)
+ {
+ i->second.clear();
+ }
+ // The listener is kept in case a fullRemove is needed later.
+}
+
+void QuestDeathListener::fullRemove(EventListener const *, Character *ch)
+{
+ ch->removeListener(&questDeathListener);
+ // Remove anything related to this character.
+ pendingQuests.erase(ch->getDatabaseID());
+}
+
void recoverQuestVar(Character *ch, std::string const &name,
QuestCallback const &f)
{