summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-10-16 21:18:11 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-10-16 21:18:11 +0000
commitd3175115354bb2417f01877a96d0068e2f2c875d (patch)
tree3fe6dde2b7922eb12bc376687ae18a59971d908e /src/inventory.cpp
parent43a80fa64acb7f02cf5305b4a3d2ef6040b4b8c9 (diff)
downloadmana-d3175115354bb2417f01877a96d0068e2f2c875d.tar.gz
mana-d3175115354bb2417f01877a96d0068e2f2c875d.tar.bz2
mana-d3175115354bb2417f01877a96d0068e2f2c875d.tar.xz
mana-d3175115354bb2417f01877a96d0068e2f2c875d.zip
Rename {read,write}{Byte,Short,Long} to {read,write}Int{8,16,32}.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 63fbab7a..3a2d3742 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -98,9 +98,9 @@ bool Inventory::contains(Item *item)
int Inventory::useItem(Item *item)
{
MessageOut outMsg;
- outMsg.writeShort(CMSG_PLAYER_INVENTORY_USE);
- outMsg.writeShort(item->getInvIndex());
- outMsg.writeLong(item->getId());
+ outMsg.writeInt16(CMSG_PLAYER_INVENTORY_USE);
+ outMsg.writeInt16(item->getInvIndex());
+ outMsg.writeInt32(item->getId());
// Note: id is dest of item, usually player_node->account_ID ??
return 0;
}
@@ -109,25 +109,25 @@ int Inventory::dropItem(Item *item, int quantity)
{
// TODO: Fix wrong coordinates of drops, serverside?
MessageOut outMsg;
- outMsg.writeShort(CMSG_PLAYER_INVENTORY_DROP);
- outMsg.writeShort(item->getInvIndex());
- outMsg.writeShort(quantity);
+ outMsg.writeInt16(CMSG_PLAYER_INVENTORY_DROP);
+ outMsg.writeInt16(item->getInvIndex());
+ outMsg.writeInt16(quantity);
return 0;
}
void Inventory::equipItem(Item *item)
{
MessageOut outMsg;
- outMsg.writeShort(CMSG_PLAYER_EQUIP);
- outMsg.writeShort(item->getInvIndex());
- outMsg.writeShort(0);
+ outMsg.writeInt16(CMSG_PLAYER_EQUIP);
+ outMsg.writeInt16(item->getInvIndex());
+ outMsg.writeInt16(0);
}
void Inventory::unequipItem(Item *item)
{
MessageOut outMsg;
- outMsg.writeShort(CMSG_PLAYER_UNEQUIP);
- outMsg.writeShort(item->getInvIndex());
+ outMsg.writeInt16(CMSG_PLAYER_UNEQUIP);
+ outMsg.writeInt16(item->getInvIndex());
// Tidy equipment directly to avoid weapon still shown bug, by instance
Equipment::getInstance()->removeEquipment(item);