diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 3abbc2c36..baa6d7462 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9354,7 +9354,7 @@ static void clif_pcname_ack(int fd, struct block_list *bl) const struct map_session_data *ssd = BL_UCCAST(BL_PC, bl); - if (ssd->fakename[0] != '\0' && ssd->disguise != -1) { + if (ssd->fakename[0] != '\0') { packet.packet_id = reqName; len = sizeof(struct packet_reqname_ack); } else { @@ -9367,7 +9367,7 @@ static void clif_pcname_ack(int fd, struct block_list *bl) packet.gid = -bl->id; } - if (ssd->fakename[0] != '\0' && ssd->disguise != -1) { + if (ssd->fakename[0] != '\0') { memcpy(packet.name, ssd->fakename, NAME_LENGTH); } else { #if PACKETVER_MAIN_NUM >= 20150225 || PACKETVER_RE_NUM >= 20141126 || defined(PACKETVER_ZERO) @@ -12377,6 +12377,42 @@ static void clif_parse_RemoveOption(int fd, struct map_session_data *sd) } } +static void clif_parse_reqGearOff(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); +static void clif_parse_reqGearOff(int fd, struct map_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20190703 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190709 + const struct PACKET_CZ_REQ_MOUNTOFF *p = RFIFOP(fd, 0); + switch (p->action) { + case REMOVE_MOUNT_DRAGON: + if (pc_isridingdragon(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_DRAGON); + break; + case REMOVE_MOUNT_MADO: + if (pc_ismadogear(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_MADOGEAR); + break; + case REMOVE_MOUNT_PECO: + if (pc_isridingpeco(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_RIDING); + break; + case REMOVE_MOUNT_FALCON: + if (pc_isfalcon(sd)) + pc->setoption(sd, sd->sc.option &~ OPTION_FALCON); + break; + case REMOVE_MOUNT_CART: + // this packet exists in clients with only new carts [4144] + if (sd->sc.data[SC_PUSH_CART]) + pc->setcart(sd, 0); + break; + case REMOVE_MOUNT_0: + case REMOVE_MOUNT_2: + default: + ShowError("Unknown action in remove mount packet: %d\n", p->action); + break; + } +#endif +} + static void clif_parse_ChangeCart(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); /// Request to change cart's visual look (CZ_REQ_CHANGECART). /// 01af <num>.W @@ -19794,7 +19830,8 @@ static void clif_cashshop_db(void) { struct config_t cashshop_conf; struct config_setting_t *cashshop = NULL, *cats = NULL; - const char *config_filename = "db/cashshop_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("cashshop_db.conf", config_filename, sizeof(config_filename)); int i, item_count_t = 0; for( i = 0; i < CASHSHOP_TAB_MAX; i++ ) { CREATE(clif->cs.data[i], struct hCSData *, 1); @@ -21065,7 +21102,8 @@ static bool clif_parse_roulette_db(void) { struct config_t roulette_conf; struct config_setting_t *roulette = NULL, *levels = NULL; - const char *config_filename = "db/roulette_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("roulette_db.conf", config_filename, sizeof(config_filename)); int i, j, item_count_t = 0; for( i = 0; i < MAX_ROULETTE_LEVEL; i++ ) { @@ -22549,7 +22587,8 @@ static bool clif_parse_attendance_db(void) { struct config_t attendance_conf; struct config_setting_t *attendance = NULL, *it = NULL; - const char *config_filename = "db/attendance_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("attendance_db.conf", config_filename, sizeof(config_filename)); int i = 0; if (!libconfig->load_file(&attendance_conf, config_filename)) @@ -24680,4 +24719,5 @@ void clif_defaults(void) clif->lapineDdukDdak_result = clif_lapineDdukDdak_result; clif->plapineDdukDdak_ack = clif_parse_lapineDdukDdak_ack; clif->plapineDdukDdak_close = clif_parse_lapineDdukDdak_close; + clif->pReqGearOff = clif_parse_reqGearOff; } |