summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/npchandler.cpp12
-rw-r--r--src/net/tmwa/npchandler.h4
2 files changed, 10 insertions, 6 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 2db9527a3..b892e152a 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -50,10 +50,12 @@ NpcHandler::NpcHandler() :
npcHandler = this;
}
-void NpcHandler::talk(const BeingId npcId) const
+void NpcHandler::talk(const Being *const being) const
{
+ if (!being)
+ return;
createOutPacket(CMSG_NPC_TALK);
- outMsg.writeBeingId(npcId, "npc id");
+ outMsg.writeBeingId(being->getId(), "npc id");
outMsg.writeInt8(0, "unused");
}
@@ -106,10 +108,12 @@ void NpcHandler::stringInput(const BeingId npcId,
outMsg.writeInt8(0, "null byte");
}
-void NpcHandler::buy(const BeingId beingId) const
+void NpcHandler::buy(const Being *const being) const
{
+ if (!being)
+ return;
createOutPacket(CMSG_NPC_BUY_SELL_REQUEST);
- outMsg.writeBeingId(beingId, "npc id");
+ outMsg.writeBeingId(being->getId(), "npc id");
outMsg.writeInt8(0, "action");
}
diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h
index fa635b332..f54c6911d 100644
--- a/src/net/tmwa/npchandler.h
+++ b/src/net/tmwa/npchandler.h
@@ -35,7 +35,7 @@ class NpcHandler final : public Ea::NpcHandler
A_DELETE_COPY(NpcHandler)
- void talk(const BeingId npcId) const override final;
+ void talk(const Being *const being) const override final;
void nextDialog(const BeingId npcId) const override final;
@@ -50,7 +50,7 @@ class NpcHandler final : public Ea::NpcHandler
void stringInput(const BeingId npcId,
const std::string &value) const override final;
- void buy(const BeingId beingId) const override final;
+ void buy(const Being *const being) const override final;
void sell(const BeingId beingId) const override final;