summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-25 08:03:00 -0700
committerIra Rice <irarice@gmail.com>2009-02-25 08:03:00 -0700
commit0aaf301660a504d94f758ac8a4d50dc33c189fa7 (patch)
treedcbd0cddf3ef58162617eb2afd02fd2c0b21f691
parentd8bc3a6418c5027d7f6c42ce8f8dceca8dee8971 (diff)
downloadmana-client-0aaf301660a504d94f758ac8a4d50dc33c189fa7.tar.gz
mana-client-0aaf301660a504d94f758ac8a4d50dc33c189fa7.tar.bz2
mana-client-0aaf301660a504d94f758ac8a4d50dc33c189fa7.tar.xz
mana-client-0aaf301660a504d94f758ac8a4d50dc33c189fa7.zip
If no network is set, then don't continue
Based on TMW commit a996d4bff3cc5a35ee5cdb6cb5bdef920cf44120 Signed-off-by: Ira Rice <irarice@gmail.com>
-rw-r--r--src/npc.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/npc.cpp b/src/npc.cpp
index eaf6b78b..832e6926 100644
--- a/src/npc.cpp
+++ b/src/npc.cpp
@@ -107,7 +107,7 @@ Being::Type NPC::getType() const
void NPC::talk()
{
- if (mTalking)
+ if (mTalking || !mNetwork)
return;
mTalking = true;
@@ -119,6 +119,9 @@ void NPC::talk()
void NPC::nextDialog()
{
+ if (!mNetwork)
+ return;
+
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_NEXT_REQUEST);
outMsg.writeInt32(mId);
@@ -156,6 +159,9 @@ void NPC::stringInput(const std::string &value)
*/
void NPC::buy()
{
+ if (!mNetwork)
+ return;
+
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_BUY_SELL_REQUEST);
outMsg.writeInt32(mId);
@@ -164,6 +170,9 @@ void NPC::buy()
void NPC::sell()
{
+ if (!mNetwork)
+ return;
+
MessageOut outMsg(mNetwork);
outMsg.writeInt16(CMSG_NPC_BUY_SELL_REQUEST);
outMsg.writeInt32(mId);