diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/net/eathena/vendinghandler.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz manaplus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/net/eathena/vendinghandler.cpp')
-rw-r--r-- | src/net/eathena/vendinghandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index 4d0d75ca1..ce2b8d384 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -69,8 +69,8 @@ void VendingHandler::buy(const Being *const being, createOutPacket(CMSG_VENDING_BUY); outMsg.writeInt16(12, "len"); outMsg.writeBeingId(being->getId(), "account id"); - outMsg.writeInt16(static_cast<int16_t>(amount), "amount"); - outMsg.writeInt16(static_cast<int16_t>(index), "index"); + outMsg.writeInt16(CAST_S16(amount), "amount"); + outMsg.writeInt16(CAST_S16(index), "index"); } void VendingHandler::buy2(const Being *const being, @@ -85,8 +85,8 @@ void VendingHandler::buy2(const Being *const being, outMsg.writeInt16(16, "len"); outMsg.writeBeingId(being->getId(), "account id"); outMsg.writeInt32(vendId, "vend id"); - outMsg.writeInt16(static_cast<int16_t>(amount), "amount"); - outMsg.writeInt16(static_cast<int16_t>(index), "index"); + outMsg.writeInt16(CAST_S16(amount), "amount"); + outMsg.writeInt16(CAST_S16(index), "index"); } void VendingHandler::createShop(const std::string &name, @@ -94,15 +94,15 @@ void VendingHandler::createShop(const std::string &name, std::vector<ShopItem*> &items) const { createOutPacket(CMSG_VENDING_CREATE_SHOP); - outMsg.writeInt16(static_cast<int16_t>(85 + items.size() * 8), "len"); + outMsg.writeInt16(CAST_S16(85 + items.size() * 8), "len"); outMsg.writeString(name, 80, "shop name"); - outMsg.writeInt8(static_cast<int8_t>(flag ? 1 : 0), "flag"); + outMsg.writeInt8(CAST_S8(flag ? 1 : 0), "flag"); FOR_EACH (std::vector<ShopItem*>::const_iterator, it, items) { const ShopItem *const item = *it; - outMsg.writeInt16(static_cast<int16_t>( + outMsg.writeInt16(CAST_S16( item->getInvIndex() + INVENTORY_OFFSET), "index"); - outMsg.writeInt16(static_cast<int16_t>(item->getQuantity()), "amount"); + outMsg.writeInt16(CAST_S16(item->getQuantity()), "amount"); outMsg.writeInt32(item->getPrice(), "price"); } } |