summaryrefslogtreecommitdiff
path: root/src/net/tmwa/npchandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-03 23:13:07 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-03 23:13:07 +0200
commit9437d4943a8b299b057020ee114b230399965abd (patch)
tree54e8d1bca3c2f5457db8402fcdfe1b9e04df54f7 /src/net/tmwa/npchandler.cpp
parentbb73cadd0afdc9fa55ea66ecedd8be53a6f3198e (diff)
downloadmanaplus-9437d4943a8b299b057020ee114b230399965abd.tar.gz
manaplus-9437d4943a8b299b057020ee114b230399965abd.tar.bz2
manaplus-9437d4943a8b299b057020ee114b230399965abd.tar.xz
manaplus-9437d4943a8b299b057020ee114b230399965abd.zip
Add colors to buy/sell dialogs.
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r--src/net/tmwa/npchandler.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index 553108fb8..8ddfeb090 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -221,12 +221,23 @@ void NpcHandler::sell(int beingId)
outMsg.writeInt8(1); // Sell
}
-void NpcHandler::buyItem(int beingId _UNUSED_, int itemId, int amount)
+void NpcHandler::buyItem(int beingId _UNUSED_, int itemId,
+ unsigned char color, int amount)
{
MessageOut outMsg(CMSG_NPC_BUY_REQUEST);
- outMsg.writeInt16(8); // One item (length of packet)
- outMsg.writeInt16(amount);
- outMsg.writeInt16(itemId);
+ if (serverVersion > 0)
+ {
+ outMsg.writeInt16(9); // One item (length of packet)
+ outMsg.writeInt16(amount);
+ outMsg.writeInt16(itemId);
+ outMsg.writeInt8(color);
+ }
+ else
+ {
+ outMsg.writeInt16(8); // One item (length of packet)
+ outMsg.writeInt16(amount);
+ outMsg.writeInt16(itemId);
+ }
}
void NpcHandler::sellItem(int beingId _UNUSED_, int itemId, int amount)