summaryrefslogtreecommitdiff
path: root/src/net/ea/npchandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-17 23:03:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-17 23:03:03 +0300
commit84b67aacfdedd8d526d246e3d3c0914a899d491c (patch)
treeee24b23538b0e68cf8addb5240fbdc2182247006 /src/net/ea/npchandler.cpp
parent0567d32aa605e66563abdb34d998cce18cea3cc2 (diff)
downloadplus-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.gz
plus-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.bz2
plus-84b67aacfdedd8d526d246e3d3c0914a899d491c.tar.xz
plus-84b67aacfdedd8d526d246e3d3c0914a899d491c.zip
Add static in npchandler.
Diffstat (limited to 'src/net/ea/npchandler.cpp')
-rw-r--r--src/net/ea/npchandler.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp
index fedc7c744..9a1592576 100644
--- a/src/net/ea/npchandler.cpp
+++ b/src/net/ea/npchandler.cpp
@@ -33,10 +33,13 @@
namespace Ea
{
-NpcHandler::NpcHandler() :
- mDialog(nullptr),
- mRequestLang(false)
+NpcDialog *NpcHandler::mDialog = nullptr;
+bool NpcHandler::mRequestLang = false;
+
+NpcHandler::NpcHandler()
{
+ mDialog = nullptr;
+ mRequestLang = false;
}
void NpcHandler::sendLetter(const int npcId A_UNUSED,
@@ -55,7 +58,7 @@ void NpcHandler::endShopping(const int beingId A_UNUSED) const
void NpcHandler::processNpcChoice(Net::MessageIn &msg)
{
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
@@ -71,7 +74,7 @@ void NpcHandler::processNpcChoice(Net::MessageIn &msg)
void NpcHandler::processNpcMessage(Net::MessageIn &msg)
{
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
const std::string message = msg.readString(msg.getLength() - 8);
@@ -85,7 +88,7 @@ void NpcHandler::processNpcMessage(Net::MessageIn &msg)
void NpcHandler::processNpcClose(Net::MessageIn &msg)
{
// Show the close button
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->showCloseButton();
@@ -94,7 +97,7 @@ void NpcHandler::processNpcClose(Net::MessageIn &msg)
void NpcHandler::processNpcNext(Net::MessageIn &msg)
{
// Show the next button
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->showNextButton();
@@ -103,7 +106,7 @@ void NpcHandler::processNpcNext(Net::MessageIn &msg)
void NpcHandler::processNpcIntInput(Net::MessageIn &msg)
{
// Request for an integer
- getNpc(msg);
+ npcHandler->getNpc(msg);
mRequestLang = false;
if (mDialog)
mDialog->integerRequest(0);
@@ -112,11 +115,11 @@ void NpcHandler::processNpcIntInput(Net::MessageIn &msg)
void NpcHandler::processNpcStrInput(Net::MessageIn &msg)
{
// Request for a string
- int npcId = getNpc(msg);
+ int npcId = npcHandler->getNpc(msg);
if (mRequestLang)
{
mRequestLang = false;
- stringInput(npcId, getLangSimple());
+ npcHandler->stringInput(npcId, getLangSimple());
}
else if (mDialog)
{