summaryrefslogtreecommitdiff
path: root/src/net/tmwa/inventoryhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/net/tmwa/inventoryhandler.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmanaplus-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/tmwa/inventoryhandler.cpp')
-rw-r--r--src/net/tmwa/inventoryhandler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp
index 24d76eab7..fa71484e6 100644
--- a/src/net/tmwa/inventoryhandler.cpp
+++ b/src/net/tmwa/inventoryhandler.cpp
@@ -73,7 +73,7 @@ void InventoryHandler::equipItem(const Item *const item) const
return;
createOutPacket(CMSG_PLAYER_EQUIP);
- outMsg.writeInt16(static_cast<int16_t>(
+ outMsg.writeInt16(CAST_S16(
item->getInvIndex() + INVENTORY_OFFSET), "index");
outMsg.writeInt16(0, "unused");
}
@@ -84,7 +84,7 @@ void InventoryHandler::unequipItem(const Item *const item) const
return;
createOutPacket(CMSG_PLAYER_UNEQUIP);
- outMsg.writeInt16(static_cast<int16_t>(
+ outMsg.writeInt16(CAST_S16(
item->getInvIndex() + INVENTORY_OFFSET), "index");
}
@@ -94,7 +94,7 @@ void InventoryHandler::useItem(const Item *const item) const
return;
createOutPacket(CMSG_PLAYER_INVENTORY_USE);
- outMsg.writeInt16(static_cast<int16_t>(
+ outMsg.writeInt16(CAST_S16(
item->getInvIndex() + INVENTORY_OFFSET), "index");
outMsg.writeInt32(item->getId(), "item id");
}
@@ -105,9 +105,9 @@ void InventoryHandler::dropItem(const Item *const item, const int amount) const
return;
createOutPacket(CMSG_PLAYER_INVENTORY_DROP);
- outMsg.writeInt16(static_cast<int16_t>(
+ outMsg.writeInt16(CAST_S16(
item->getInvIndex() + INVENTORY_OFFSET), "index");
- outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
+ outMsg.writeInt16(CAST_S16(amount), "amount");
}
void InventoryHandler::closeStorage() const
@@ -124,7 +124,7 @@ void InventoryHandler::moveItem2(const InventoryTypeT source,
destination == InventoryType::Storage)
{
createOutPacket(CMSG_MOVE_TO_STORAGE);
- outMsg.writeInt16(static_cast<int16_t>(slot + INVENTORY_OFFSET),
+ outMsg.writeInt16(CAST_S16(slot + INVENTORY_OFFSET),
"index");
outMsg.writeInt32(amount, "amount");
}
@@ -132,7 +132,7 @@ void InventoryHandler::moveItem2(const InventoryTypeT source,
destination == InventoryType::Inventory)
{
createOutPacket(CMSG_MOVE_FROM_STORAGE);
- outMsg.writeInt16(static_cast<int16_t>(slot + STORAGE_OFFSET),
+ outMsg.writeInt16(CAST_S16(slot + STORAGE_OFFSET),
"index");
outMsg.writeInt32(amount, "amount");
}
@@ -161,7 +161,7 @@ int InventoryHandler::convertFromServerSlot(const int serverSlot) const
if (serverSlot < 0 || serverSlot > 13)
return 0;
- return static_cast<int>(EQUIP_CONVERT[serverSlot]);
+ return CAST_S32(EQUIP_CONVERT[serverSlot]);
}
void InventoryHandler::selectCart(const BeingId accountId A_UNUSED,