diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 22:09:04 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-08-26 22:09:04 +0000 |
commit | 40339bebb026cd553aacbbff6f2fe1aa14816d5a (patch) | |
tree | f6398430043accbc90170ac15c62c8deebd895eb /src/npc.cpp | |
parent | fd279ae77295a6babedd31202078862eabcada9f (diff) | |
download | mana-40339bebb026cd553aacbbff6f2fe1aa14816d5a.tar.gz mana-40339bebb026cd553aacbbff6f2fe1aa14816d5a.tar.bz2 mana-40339bebb026cd553aacbbff6f2fe1aa14816d5a.tar.xz mana-40339bebb026cd553aacbbff6f2fe1aa14816d5a.zip |
Got rid of the default MessageOut constructor, since all messages should have
an ID.
Diffstat (limited to 'src/npc.cpp')
-rw-r--r-- | src/npc.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/npc.cpp b/src/npc.cpp index a14b6d24..13025469 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -48,8 +48,7 @@ NPC::getType() const void NPC::talk() { - MessageOut outMsg; - outMsg.writeShort(CMSG_NPC_TALK); + MessageOut outMsg(CMSG_NPC_TALK); outMsg.writeLong(mId); outMsg.writeByte(0); current_npc = this; @@ -58,16 +57,14 @@ NPC::talk() void NPC::nextDialog() { - MessageOut outMsg; - outMsg.writeShort(CMSG_NPC_NEXT_REQUEST); + MessageOut outMsg(CMSG_NPC_NEXT_REQUEST); outMsg.writeLong(mId); } void NPC::dialogChoice(char choice) { - MessageOut outMsg; - outMsg.writeShort(CMSG_NPC_LIST_CHOICE); + MessageOut outMsg(CMSG_NPC_LIST_CHOICE); outMsg.writeLong(mId); outMsg.writeByte(choice); } @@ -79,8 +76,7 @@ NPC::dialogChoice(char choice) void NPC::buy() { - MessageOut outMsg; - outMsg.writeShort(CMSG_NPC_BUY_SELL_REQUEST); + MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeLong(mId); outMsg.writeByte(0); } @@ -88,8 +84,7 @@ NPC::buy() void NPC::sell() { - MessageOut outMsg; - outMsg.writeShort(CMSG_NPC_BUY_SELL_REQUEST); + MessageOut outMsg(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeLong(mId); outMsg.writeByte(1); } |