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/gui/trade.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/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index 6b247901..0cd49013 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -214,8 +214,7 @@ void TradeWindow::receivedOk(bool own) void TradeWindow::tradeItem(Item *item, int quantity) { - MessageOut outMsg; - outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + MessageOut outMsg(CMSG_TRADE_ITEM_ADD_REQUEST); outMsg.writeShort(item->getInvIndex()); outMsg.writeLong(quantity); } @@ -286,8 +285,7 @@ void TradeWindow::action(const std::string &eventId, gcn::Widget *widget) } else if (eventId == "cancel") { - MessageOut outMsg; - outMsg.writeShort(CMSG_TRADE_CANCEL_REQUEST); + MessageOut outMsg(CMSG_TRADE_CANCEL_REQUEST); } else if (eventId == "ok") { @@ -297,20 +295,17 @@ void TradeWindow::action(const std::string &eventId, gcn::Widget *widget) { mMoneyField->setText(toString(tempInt)); - MessageOut outMsg; - outMsg.writeShort(CMSG_TRADE_ITEM_ADD_REQUEST); + MessageOut outMsg(CMSG_TRADE_ITEM_ADD_REQUEST); outMsg.writeShort(0); outMsg.writeLong(tempInt); } else { mMoneyField->setText(""); } mMoneyField->setEnabled(false); - MessageOut outMsg; - outMsg.writeShort(CMSG_TRADE_ADD_COMPLETE); + MessageOut outMsg(CMSG_TRADE_ADD_COMPLETE); } else if (eventId == "trade") { - MessageOut outMsg; - outMsg.writeShort(CMSG_TRADE_OK); + MessageOut outMsg(CMSG_TRADE_OK); } } |