diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 0d25be0a6..d499cf67f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -42,7 +42,7 @@ #include "common/conf.h" #include "common/ers.h" #include "common/grfio.h" -#include "common/malloc.h" +#include "common/memmgr.h" #include "common/mmo.h" // NEW_CARTS #include "common/nullpo.h" #include "common/random.h" @@ -10130,6 +10130,9 @@ void clif_parse_WisMessage(int fd, struct map_session_data* sd) clif->message(fd, msg_fd(fd,1402)); } return; + } else if (strcmpi(&chname[1], channel->config->ally_name) == 0) { + clif->message(fd, msg_fd(fd,1294)); // You're not allowed to talk on this channel + return; } } @@ -18362,7 +18365,7 @@ void clif_openmergeitem(int fd, struct map_session_data *sd) for (i = 0; i < MAX_INVENTORY; i++) { struct item *item_data = &sd->status.inventory[i]; - if (item_data->nameid == 0 || !itemdb->isstackable(item_data->nameid)) + if (item_data->nameid == 0 || !itemdb->isstackable(item_data->nameid) || item_data->bound != IBT_NONE) continue; merge_items[n].nameid = item_data->nameid; @@ -18436,7 +18439,7 @@ void clif_ackmergeitems(int fd, struct map_session_data *sd) it = &sd->status.inventory[idx]; - if (it->nameid == 0 || !itemdb->isstackable(it->nameid)) + if (it->nameid == 0 || !itemdb->isstackable(it->nameid) || it->bound != IBT_NONE) continue; if (nameid == 0) @@ -18578,12 +18581,12 @@ int clif_parse(int fd) { if (RFIFOREST(fd) < 2) return 0; - if( HPM->packetsc[hpClif_Parse] ) { - int r; - if( (r = HPM->parse_packets(fd,hpClif_Parse)) ) { - if( r == 1 ) continue; - if( r == 2 ) return 0; - } + if (VECTOR_LENGTH(HPM->packets[hpClif_Parse]) > 0) { + int result = HPM->parse_packets(fd,hpClif_Parse); + if (result == 1) + continue; + if (result == 2) + return 0; } if( sd ) @@ -18680,6 +18683,19 @@ int clif_parse(int fd) { return 0; } +/** + * Returns information about the given packet ID. + * + * @param packet_id The packet ID. + * @return The corresponding packet_db entry, if any. + */ +const struct s_packet_db *clif_packet(int packet_id) +{ + if (packet_id < MIN_PACKET_DB || packet_id > MAX_PACKET_DB || packet_db[packet_id].len == 0) + return NULL; + return &packet_db[packet_id]; +} + static void __attribute__ ((unused)) packetdb_addpacket(short cmd, int len, ...) { va_list va; int i; @@ -18815,6 +18831,7 @@ void clif_defaults(void) { clif->parse = clif_parse; clif->parse_cmd = clif_parse_cmd_optional; clif->decrypt_cmd = clif_decrypt_cmd; + clif->packet = clif_packet; /* auth */ clif->authok = clif_authok; clif->authrefuse = clif_authrefuse; |