summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-11 14:30:58 -0300
committershennetsind <ind@henn.et>2013-07-11 14:30:58 -0300
commite3761a81ba4c941ba04a2b6b1f161a6e1402ebe9 (patch)
tree2621afd903332e09ff8459796c2a01c935ae4eb2 /src/map/clif.c
parent1708b62c12693cf55cdb97092ec7ec6692e8e272 (diff)
downloadhercules-e3761a81ba4c941ba04a2b6b1f161a6e1402ebe9.tar.gz
hercules-e3761a81ba4c941ba04a2b6b1f161a6e1402ebe9.tar.bz2
hercules-e3761a81ba4c941ba04a2b6b1f161a6e1402ebe9.tar.xz
hercules-e3761a81ba4c941ba04a2b6b1f161a6e1402ebe9.zip
Fix to Bug #7434
Fixing a ancient bug where placing a item from inventory to cart when cart is full would render such item un-clickable, same for when doing so from storage to cart. Special Thanks to Yommy for all the data, jTynne for bringing this up. http://hercules.ws/board/tracker/issue-7434-weightinability-to-click-item-issue/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index f17766f50..0000633bc 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11133,13 +11133,16 @@ void clif_parse_StopAttack(int fd,struct map_session_data *sd)
/// Request to move an item from inventory to cart (CZ_MOVE_ITEM_FROM_BODY_TO_CART).
/// 0126 <index>.W <amount>.L
-void clif_parse_PutItemToCart(int fd,struct map_session_data *sd)
-{
+void clif_parse_PutItemToCart(int fd,struct map_session_data *sd) {
+ int flag = 0;
if (pc_istrading(sd))
return;
if (!pc_iscarton(sd))
return;
- pc->putitemtocart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4));
+ if ( (flag = pc->putitemtocart(sd,RFIFOW(fd,2)-2,RFIFOL(fd,4))) ) {
+ clif->dropitem(sd, RFIFOW(fd,2)-2,0);
+ clif->cart_additem_ack(sd,flag == 1?0x0:0x1);
+ }
}
@@ -17580,7 +17583,18 @@ void clif_skill_cooldown_list(int fd, struct skill_cd* cd) {
WFIFOSET(fd,4+(offset*count));
}
-
+/* [Ind/Hercules] - Data Thanks to Yommy
+ * - ADDITEM_TO_CART_FAIL_WEIGHT = 0x0
+ * - ADDITEM_TO_CART_FAIL_COUNT = 0x1
+ */
+void clif_cart_additem_ack(struct map_session_data *sd, int flag) {
+ struct packet_cart_additem_ack p;
+
+ p.PacketType = cart_additem_ackType;
+ p.result = (char)flag;
+
+ clif->send(&p,sizeof(p), &sd->bl, SELF);
+}
/* */
unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
if( sd ) {
@@ -17917,6 +17931,7 @@ void clif_defaults(void) {
clif->addcards2 = clif_addcards2;
clif->item_sub = clif_item_sub;
clif->getareachar_item = clif_getareachar_item;
+ clif->cart_additem_ack = clif_cart_additem_ack;
/* unit-related */
clif->clearunit_single = clif_clearunit_single;
clif->clearunit_area = clif_clearunit_area;