diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 16:55:07 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-05-18 16:55:07 +0000 |
commit | 3c0bb6cec420f251ffbc45eaf9196e11fc72dfa1 (patch) | |
tree | ffcce8e25146fc45cf14d9ba9257b10834e57744 /src/map/clif.c | |
parent | 1f82fb3ed60e57b7fecc18cd871747af3dca461b (diff) | |
download | hercules-3c0bb6cec420f251ffbc45eaf9196e11fc72dfa1.tar.gz hercules-3c0bb6cec420f251ffbc45eaf9196e11fc72dfa1.tar.bz2 hercules-3c0bb6cec420f251ffbc45eaf9196e11fc72dfa1.tar.xz hercules-3c0bb6cec420f251ffbc45eaf9196e11fc72dfa1.zip |
- Rewrote/cleaned up several functions in storage.c
- Optimized pc_additem comparisons to account for items with more than four slots.
- Updated clif.c to enable retrieval of items from cart/storage while trading. Exception is retrieving items from the cart while vending.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6642 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 95d7c9ceb..1a52a33d1 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9432,9 +9432,6 @@ void clif_parse_PutItemToCart(int fd,struct map_session_data *sd) void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
{
RFIFOHEAD(fd);
-
- if (clif_trading(sd))
- return;
pc_getitemfromcart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
}
@@ -9951,7 +9948,7 @@ void clif_parse_MoveToKafra(int fd, struct map_session_data *sd) { item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-2;
item_amount = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
- if (item_index < 0 || item_index >= MAX_INVENTORY)
+ if (item_index < 0 || item_index >= MAX_INVENTORY || item_amount < 1)
return;
if (sd->state.storage_flag == 1)
@@ -9968,9 +9965,6 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd) { int item_index, item_amount;
RFIFOHEAD(fd);
- if (clif_trading(sd))
- return;
-
item_index = RFIFOW(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[0])-1;
item_amount = RFIFOL(fd,packet_db[sd->packet_ver][RFIFOW(fd,0)].pos[1]);
@@ -9987,7 +9981,7 @@ void clif_parse_MoveFromKafra(int fd,struct map_session_data *sd) { void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
- if (clif_trading(sd))
+ if(sd->vender_id)
return;
if (sd->state.storage_flag == 1)
@@ -10003,7 +9997,7 @@ void clif_parse_MoveToKafraFromCart(int fd, struct map_session_data *sd) { void clif_parse_MoveFromKafraToCart(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
- if (clif_trading(sd))
+ if (sd->vender_id)
return;
if (sd->state.storage_flag == 1)
storage_storagegettocart(sd, RFIFOW(fd,2)-1, RFIFOL(fd,4));
@@ -10152,8 +10146,6 @@ void clif_parse_VendingListReq(int fd, struct map_session_data *sd) { */
void clif_parse_PurchaseReq(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
- if (clif_trading(sd))
- return;
vending_purchasereq(sd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8));
}
|