diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index f6caa502e..cd4281b6f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2935,10 +2935,10 @@ static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type nullpo_retv(sd); nullpo_retv(name); - char buf[sizeof(struct ZC_INVENTORY_START) + 24]; + char buf[sizeof(struct PACKET_ZC_INVENTORY_START) + 24]; memset(buf, 0, sizeof(buf)); - struct ZC_INVENTORY_START *p = (struct ZC_INVENTORY_START *)buf; - p->packetType = 0xb08; + struct PACKET_ZC_INVENTORY_START *p = (struct PACKET_ZC_INVENTORY_START *)buf; + p->packetType = HEADER_ZC_INVENTORY_START; #if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 p->invType = type; #endif @@ -2946,11 +2946,11 @@ static void clif_inventoryStart(struct map_session_data *sd, enum inventory_type int strLen = (int)safestrnlen(name, 24) + 1; if (strLen > 24) strLen = 24; - const int len = sizeof(struct ZC_INVENTORY_START) + strLen; + const int len = sizeof(struct PACKET_ZC_INVENTORY_START) + strLen; p->packetLength = len; safestrncpy(p->name, name, strLen); #else - const int len = sizeof(struct ZC_INVENTORY_START); + const int len = sizeof(struct PACKET_ZC_INVENTORY_START); safestrncpy(p->name, name, NAME_LENGTH); #endif clif->send(p, len, &sd->bl, SELF); @@ -2962,8 +2962,8 @@ static void clif_inventoryEnd(struct map_session_data *sd, enum inventory_type t #if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 nullpo_retv(sd); - struct ZC_INVENTORY_END p; - p.packetType = 0xb0b; + struct PACKET_ZC_INVENTORY_END p; + p.packetType = HEADER_ZC_INVENTORY_END; #if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002 p.invType = type; #endif @@ -5268,7 +5268,7 @@ static void clif_playerSkillToPacket(struct map_session_data *sd, struct SKILLDA skillData->sp = 0; skillData->range2 = 0; } -#if PACKETVER_RE_NUM >= 20190807 +#if PACKETVER_RE_NUM >= 20190807 || PACKETVER_ZERO_NUM >= 20190918 if (newSkill) skillData->level2 = 0; else @@ -5419,7 +5419,7 @@ static void clif_skillinfo(struct map_session_data *sd, int skill_id, int inf) p->sp = 0; p->range2 = 0; } -#if PACKETVER_RE_NUM >= 20190807 +#if PACKETVER_RE_NUM >= 20190807 || PACKETVER_ZERO_NUM >= 20190918 p->level2 = skill_lv; #endif if (sd->status.skill[idx].flag == SKILL_FLAG_PERMANENT) @@ -5899,7 +5899,7 @@ static void clif_skill_estimation(struct map_session_data *sd, struct block_list { struct status_data *dstatus; unsigned char buf[64]; - int i;//, fix; + int i, fix; nullpo_retv(sd); nullpo_retv(dst); @@ -5921,9 +5921,9 @@ static void clif_skill_estimation(struct map_session_data *sd, struct block_list + ((battle_config.estimation_type&2) ? dstatus->mdef2 : 0); WBUFW(buf,18) = dstatus->def_ele; for(i=0;i<9;i++) { - WBUFB(buf,20+i)= (unsigned char)battle->attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv); + // WBUFB(buf,20+i)= (unsigned char)battle->attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv); // The following caps negative attributes to 0 since the client displays them as 255-fix. [Skotlex] - //WBUFB(buf,20+i)= (unsigned char)((fix=battle->attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv))<0?0:fix); + WBUFB(buf,20+i)= (unsigned char)((fix=battle->attr_ratio(i+1,dstatus->def_ele, dstatus->ele_lv))<0?0:fix); } clif->send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF); @@ -10769,7 +10769,7 @@ static void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) if( map->list[sd->bl.m].flag.allowks && !map_flag_ks(sd->bl.m) ) { char output[128]; - sprintf(output, "[ Kill Steal Protection Disabled. KS is allowed in this map ]"); + sprintf(output, "%s", msg_sd(sd, 893)); // [ Kill Steal Protection Disabled. KS is allowed in this map ] clif->broadcast(&sd->bl, output, (int)strlen(output) + 1, BC_BLUE, SELF); } @@ -11664,7 +11664,7 @@ static void clif_parse_WisMessage(int fd, struct map_session_data *sd) // if player is autotrading if (dstsd->state.autotrade) { char output[256]; - sprintf(output, "%s is in autotrade mode and cannot receive whispered messages.", dstsd->status.name); + sprintf(output, msg_fd(fd, 894), dstsd->status.name); // %s is in autotrade mode and cannot receive whispered messages. clif->wis_message(fd, map->wisp_server_name, output, (int)strlen(output)); return; } @@ -16091,7 +16091,10 @@ static void clif_ranklist(struct map_session_data *sd, enum fame_list_type type) p->packetType = HEADER_ZC_ACK_RANKING; p->rankType = type; #if PACKETVER_MAIN_NUM >= 20190731 || PACKETVER_RE_NUM >= 20190703 || PACKETVER_ZERO_NUM >= 20190724 +PRAGMA_GCC9(GCC diagnostic push) +PRAGMA_GCC9(GCC diagnostic ignored "-Waddress-of-packed-member") clif->ranklist_sub2(p->chars, p->points, type); +PRAGMA_GCC9(GCC diagnostic pop) #else clif->ranklist_sub(&p->ranks, type); #endif @@ -16683,7 +16686,7 @@ static void clif_Mail_refreshinbox(struct map_session_data *sd) if( md->full ) {// TODO: is this official? char output[100]; - sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX); + sprintf(output, msg_sd(sd, 511), MAIL_MAX_INBOX); // Inbox is full (Max %d). Delete some mails. clif_disp_onlyself(sd, output); } } @@ -20599,7 +20602,7 @@ static void clif_show_modifiers(struct map_session_data *sd) if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) { char output[128]; - snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%", + snprintf(output,128, msg_sd(sd, 896), // Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%% sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death); clif->broadcast2(&sd->bl, output, (int)strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF); } |