summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-12 23:38:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-12 23:38:04 +0300
commitd3af59b8eedae98a49367e2ac37f2ab1b79c0557 (patch)
tree5c004058a74022e2a1cb33d497b2533bf3e9b085
parent77a5341118e27572c9b9db90d42120c84d204d77 (diff)
downloadmv-d3af59b8eedae98a49367e2ac37f2ab1b79c0557.tar.gz
mv-d3af59b8eedae98a49367e2ac37f2ab1b79c0557.tar.bz2
mv-d3af59b8eedae98a49367e2ac37f2ab1b79c0557.tar.xz
mv-d3af59b8eedae98a49367e2ac37f2ab1b79c0557.zip
remove npc dialog wrapper.
-rw-r--r--src/net/ea/npchandler.cpp2
-rw-r--r--src/net/ea/npchandler.h6
-rw-r--r--src/net/eathena/npchandler.cpp8
-rw-r--r--src/net/tmwa/npchandler.cpp8
4 files changed, 8 insertions, 16 deletions
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index 427415f51..78a46f630 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -55,7 +55,7 @@ void NpcHandler::clearDialogs()
const NpcDialogs::iterator it_end = mNpcDialogs.end();
while (it != it_end)
{
- delete (*it).second.dialog;
+ delete (*it).second;
++ it;
}
mNpcDialogs.clear();
diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h
index c87cb0ce3..9fe07f531 100644
--- a/src/net/ea/npchandler.h
+++ b/src/net/ea/npchandler.h
@@ -66,11 +66,7 @@ class NpcHandler : public Net::NpcHandler
void processNpcStrInput(Net::MessageIn &msg);
protected:
- typedef struct
- {
- NpcDialog* dialog;
- } Wrapper;
- typedef std::map<int, Wrapper> NpcDialogs;
+ typedef std::map<int, NpcDialog*> NpcDialogs;
NpcDialogs mNpcDialogs;
NpcDialog *mDialog;
};
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp
index 4730067fd..fc5744bfd 100644
--- a/src/net/eathena/npchandler.cpp
+++ b/src/net/eathena/npchandler.cpp
@@ -133,7 +133,7 @@ void NpcHandler::closeDialog(const int npcId)
const NpcDialogs::iterator it = mNpcDialogs.find(npcId);
if (it != mNpcDialogs.end())
{
- NpcDialog *const dialog = (*it).second.dialog;
+ NpcDialog *const dialog = (*it).second;
if (dialog)
dialog->close();
if (dialog == mDialog)
@@ -227,14 +227,12 @@ int NpcHandler::getNpc(Net::MessageIn &msg, const bool haveLength)
mDialog->saveCamera();
if (player_node)
player_node->stopWalking(false);
- Wrapper wrap;
- wrap.dialog = mDialog;
- mNpcDialogs[npcId] = wrap;
+ mNpcDialogs[npcId] = mDialog;
}
}
else
{
- NpcDialog *const dialog = diag->second.dialog;
+ NpcDialog *const dialog = diag->second;
if (mDialog && mDialog != dialog)
mDialog->restoreCamera();
mDialog = dialog;
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index fa9647b9d..36eca01aa 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -132,7 +132,7 @@ void NpcHandler::closeDialog(const int npcId)
const NpcDialogs::iterator it = mNpcDialogs.find(npcId);
if (it != mNpcDialogs.end())
{
- NpcDialog *const dialog = (*it).second.dialog;
+ NpcDialog *const dialog = (*it).second;
if (dialog)
dialog->close();
if (dialog == mDialog)
@@ -236,14 +236,12 @@ int NpcHandler::getNpc(Net::MessageIn &msg, const bool haveLength)
mDialog->saveCamera();
if (player_node)
player_node->stopWalking(false);
- Wrapper wrap;
- wrap.dialog = mDialog;
- mNpcDialogs[npcId] = wrap;
+ mNpcDialogs[npcId] = mDialog;
}
}
else
{
- NpcDialog *const dialog = diag->second.dialog;
+ NpcDialog *const dialog = diag->second;
if (mDialog && mDialog != dialog)
mDialog->restoreCamera();
mDialog = dialog;