diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-12-14 20:01:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-14 23:52:47 +0300 |
commit | 2c8e11ba55a7257124610b1ee7286e07bf6b1fe9 (patch) | |
tree | d21f2137bb4f6df31eebffc74c7799b762a4d01e /src/map | |
parent | ec05dccfddedf8250f1df61ce94dafb6823dace7 (diff) | |
download | hercules-2c8e11ba55a7257124610b1ee7286e07bf6b1fe9.tar.gz hercules-2c8e11ba55a7257124610b1ee7286e07bf6b1fe9.tar.bz2 hercules-2c8e11ba55a7257124610b1ee7286e07bf6b1fe9.tar.xz hercules-2c8e11ba55a7257124610b1ee7286e07bf6b1fe9.zip |
Add additional checks into CZ_INVENTORY_EXPAND and CZ_INVENTORY_EXPAND_CONFIRMED packets.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 123dd1a52..a81b967d1 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3111,6 +3111,15 @@ static void clif_parse_inventoryExpansion(int fd, struct map_session_data *sd) _ static void clif_parse_inventoryExpansion(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114 + if (pc_isdead(sd) || pc_cant_act(sd)) { + clif->inventoryExpandAck(sd, EXPAND_INVENTORY_OTHER_WORK, 0); + return; + } + if (sd->status.inventorySize == MAX_INVENTORY) { + clif->inventoryExpandAck(sd, EXPAND_INVENTORY_MAX_SIZE, 0); + return; + } + char evname[EVENT_NAME_LENGTH]; struct event_data *ev = NULL; @@ -3127,6 +3136,15 @@ static void clif_parse_inventoryExpansionConfirmed(int fd, struct map_session_da static void clif_parse_inventoryExpansionConfirmed(int fd, struct map_session_data *sd) { #if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114 + if (pc_isdead(sd) || pc_cant_act(sd)) { + clif->inventoryExpandResult(sd, EXPAND_INVENTORY_RESULT_OTHER_WORK); + return; + } + if (sd->status.inventorySize == MAX_INVENTORY) { + clif->inventoryExpandResult(sd, EXPAND_INVENTORY_RESULT_MAX_SIZE); + return; + } + char evname[EVENT_NAME_LENGTH]; struct event_data *ev = NULL; |