summaryrefslogtreecommitdiff
path: root/src/gui/trade.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 22:09:04 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-08-26 22:09:04 +0000
commit40339bebb026cd553aacbbff6f2fe1aa14816d5a (patch)
treef6398430043accbc90170ac15c62c8deebd895eb /src/gui/trade.cpp
parentfd279ae77295a6babedd31202078862eabcada9f (diff)
downloadmana-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.cpp15
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);
}
}