From 40339bebb026cd553aacbbff6f2fe1aa14816d5a Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 26 Aug 2006 22:09:04 +0000 Subject: Got rid of the default MessageOut constructor, since all messages should have an ID. --- src/npc.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/npc.cpp') 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); } -- cgit v1.2.3-70-g09d2