summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 22:56:29 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-13 22:56:29 +0000
commit3dc311a652d1fda1252903a974920395e56e5668 (patch)
tree7098d55015d28a4d973c5073d7c9e45ae03ec400 /src/inventory.cpp
parent78771718bf7af14273d7bb0090dccff97b00b397 (diff)
downloadmana-3dc311a652d1fda1252903a974920395e56e5668.tar.gz
mana-3dc311a652d1fda1252903a974920395e56e5668.tar.bz2
mana-3dc311a652d1fda1252903a974920395e56e5668.tar.xz
mana-3dc311a652d1fda1252903a974920395e56e5668.zip
Merged with SDL_NET_TEST branch.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 9e3ad375..cf39f042 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -90,41 +90,41 @@ bool Inventory::contains(Item *item)
int Inventory::useItem(Item *item)
{
- WFIFOW(0) = net_w_value(0x00a7);
- WFIFOW(2) = net_w_value(item->getInvIndex());
- WFIFOL(4) = net_l_value(item->getId());
+ writeWord(0, 0x00a7);
+ writeWord(2, item->getInvIndex());
+ writeLong(4, item->getId());
// Note: id is dest of item, usually player_node->account_ID ??
- WFIFOSET(8);
- while ((out_size > 0)) flush();
+ writeSet(8);
+ flush();
return 0;
}
int Inventory::dropItem(Item *item, int quantity)
{
// TODO: Fix wrong coordinates of drops, serverside?
- WFIFOW(0) = net_w_value(0x00a2);
- WFIFOW(2) = net_w_value(item->getInvIndex());
- WFIFOW(4) = net_w_value(quantity);
- WFIFOSET(6);
- while ((out_size > 0)) flush();
+ writeWord(0, 0x00a2);
+ writeWord(2, item->getInvIndex());
+ writeWord(4, quantity);
+ writeSet(6);
+ flush();
return 0;
}
void Inventory::equipItem(Item *item)
{
- WFIFOW(0) = net_w_value(0x00a9);
- WFIFOW(2) = net_w_value(item->getInvIndex());
- WFIFOW(4) = net_w_value(0);
- WFIFOSET(6);
- while ((out_size > 0)) flush();
+ writeWord(0, 0x00a9);
+ writeWord(2, item->getInvIndex());
+ writeWord(4, 0);
+ writeSet(6);
+ flush();
}
void Inventory::unequipItem(Item *item)
{
- WFIFOW(0) = net_w_value(0x00ab);
- WFIFOW(2) = net_w_value(item->getInvIndex());
- WFIFOSET(4);
- while ((out_size > 0)) flush();
+ writeWord(0, 0x00ab);
+ writeWord(2, item->getInvIndex());
+ writeSet(4);
+ flush();
// Tidy equipment directly to avoid weapon still shown bug, by instance
Equipment::getInstance()->removeEquipment(item);