diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 28b20c9e2..de0f0573f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -679,7 +679,7 @@ void clif_authok(struct map_session_data *sd) p.font = sd->status.font; #endif // Some clients smaller than 20160330 cant be tested [4144] -#if PACKETVER >= 20141016 && PACKETVER < 20160330 +#if PACKETVER >= 20141022 && PACKETVER < 20160330 p.sex = sd->status.sex; #endif clif->send(&p,sizeof(p),&sd->bl,SELF); @@ -888,8 +888,8 @@ void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, un } #if PACKETVER < 4 - *rhand = sd->status.weapon; - *lhand = sd->status.shield; + *rhand = sd->status.look.weapon; + *lhand = sd->status.look.shield; #else if (sd->equip_index[EQI_HAND_R] >= 0 && sd->inventory_data[sd->equip_index[EQI_HAND_R]]) @@ -1491,8 +1491,8 @@ bool clif_spawn(struct block_list *bl) } if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0) clif->spiritcharm(sd); - if (sd->status.robe) - clif->refreshlook(bl,bl->id,LOOK_ROBE,sd->status.robe,AREA); + if (sd->status.look.robe != 0) + clif->refreshlook(bl, bl->id, LOOK_ROBE, sd->status.look.robe, AREA); } break; case BL_MOB: @@ -2414,9 +2414,9 @@ void clif_addcards2(unsigned short *cards, struct item* item) { int clif_add_item_options(struct ItemOptions *buf, const struct item *it) { int i = 0, j = 0, total_options = 0; - + nullpo_ret(buf); - + // Append the buffer with existing options first. for (i = 0; i < MAX_ITEM_OPTIONS; i++) { if (it->option[i].index) { @@ -2433,7 +2433,7 @@ void clif_addcards2(unsigned short *cards, struct item* item) { WBUFW(buf, j * 5 + 2) = 0; WBUFB(buf, j * 5 + 4) = 0; } - + return total_options; } @@ -2488,7 +2488,7 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) #endif #if PACKETVER >= 20160921 p.favorite = sd->status.inventory[n].favorite; - p.look = sd->inventory_data[n]->look; + p.look = sd->inventory_data[n]->view_sprite; #endif } p.result = (unsigned char)fail; @@ -2597,7 +2597,7 @@ void clif_item_equip(short idx, struct EQUIPITEM_INFO *p, struct item *it, struc #endif #if PACKETVER >= 20100629 - p->wItemSpriteNumber = (id->equip&EQP_VISIBLE) ? id->look : 0; + p->wItemSpriteNumber = (id->equip&EQP_VISIBLE) ? id->view_sprite : 0; #endif #if PACKETVER >= 20120925 @@ -3035,12 +3035,12 @@ void clif_updatestatus(struct map_session_data *sd,int type) break; case SP_BASEEXP: WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=sd->status.base_exp; + WFIFOL(fd,4)=(uint32)(sd->status.base_exp); len = packet_len(0xb1); break; case SP_JOBEXP: WFIFOW(fd,0)=0xb1; - WFIFOL(fd,4)=sd->status.job_exp; + WFIFOL(fd,4)=(uint32)(sd->status.job_exp); len = packet_len(0xb1); break; case SP_NEXTBASEEXP: @@ -3183,7 +3183,9 @@ void clif_changelook(struct block_list *bl,int type,int val) struct status_change* sc; struct view_data* vd; enum send_target target = AREA; +#if PACKETVER >= 4 int val2 = 0; +#endif nullpo_retv(bl); sd = BL_CAST(BL_PC, bl); @@ -3527,7 +3529,7 @@ void clif_equipitemack(struct map_session_data *sd,int n,int pos,enum e_EQUIP_IT p.wearLocation = pos; #if PACKETVER >= 20100629 if (result == EIA_SUCCESS && sd->inventory_data[n]->equip&EQP_VISIBLE) - p.wItemSpriteNumber = sd->inventory_data[n]->look; + p.wItemSpriteNumber = sd->inventory_data[n]->view_sprite; else p.wItemSpriteNumber = 0; #endif @@ -4309,8 +4311,8 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) { clif->specialeffect_single(bl,421,sd->fd); if (tsd->bg_id != 0 && map->list[tsd->bl.m].flag.battleground) clif->sendbgemblem_single(sd->fd,tsd); - if (tsd->status.robe) - clif->refreshlook(&sd->bl,bl->id,LOOK_ROBE,tsd->status.robe,SELF); + if (tsd->status.look.robe != 0) + clif->refreshlook(&sd->bl, bl->id, LOOK_ROBE, tsd->status.look.robe, SELF); } break; case BL_MER: // Devotion Effects @@ -6402,7 +6404,7 @@ void clif_vendinglist(struct map_session_data* sd, unsigned int id, struct s_ven // [4144] date 20160921 not confirmend. Can be bigger or smaller #if PACKETVER >= 20160921 WFIFOL(fd, offset + 47 + i * item_length) = pc->item_equippoint(sd, data); - WFIFOW(fd, offset + 51 + i * item_length) = data->look; + WFIFOW(fd, offset + 51 + i * item_length) = data->view_sprite; #endif } WFIFOSET(fd,WFIFOW(fd,2)); @@ -9449,8 +9451,8 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) { // Character Looks #if PACKETVER < 4 - clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon); - clif->changelook(&sd->bl,LOOK_SHIELD,sd->status.shield); + clif->changelook(&sd->bl, LOOK_WEAPON, sd->status.look.weapon); + clif->changelook(&sd->bl, LOOK_SHIELD, sd->status.look.shield); #else clif->changelook(&sd->bl,LOOK_WEAPON,0); #endif @@ -19344,7 +19346,7 @@ void clif_parse_rodex_checkname(int fd, struct map_session_data *sd) int char_id = 0, base_level = 0; short class = 0; char name[NAME_LENGTH]; - + safestrncpy(name, rPacket->Name, NAME_LENGTH); rodex->check_player(sd, name, &base_level, &char_id, &class); @@ -19547,7 +19549,7 @@ void clif_rodex_read_mail(struct map_session_data *sd, int8 opentype, struct rod nullpo_retv(sd); nullpo_retv(msg); - + fd = sd->fd; body_len = (int)strlen(msg->body) + 1; size = sizeof(*sPacket); @@ -19624,7 +19626,7 @@ void clif_parse_rodex_request_zeny(int fd, struct map_session_data *sd) __attrib void clif_parse_rodex_request_zeny(int fd, struct map_session_data *sd) { const struct PACKET_CZ_REQ_ZENY_FROM_MAIL *rPacket = RFIFOP(fd, 0); - + rodex->get_zeny(sd, rPacket->opentype, rPacket->MailID); } @@ -19665,7 +19667,7 @@ void clif_rodex_request_items(struct map_session_data *sd, int8 opentype, int64 nullpo_retv(sd); fd = sd->fd; - + WFIFOHEAD(fd, sizeof(*sPacket)); sPacket = WFIFOP(fd, 0); sPacket->PacketType = rodexgetitem; @@ -19679,7 +19681,7 @@ void clif_rodex_request_items(struct map_session_data *sd, int8 opentype, int64 void clif_rodex_icon(int fd, bool show) { // packet add date is 20140716, but from players reports it wrong. Using closer known correct version. -#if PACKETVER >= 20150513 +#if PACKETVER >= 20141112 WFIFOHEAD(fd, 3); WFIFOW(fd, 0) = rodexicon; WFIFOB(fd, 2) = (show == true ? 1 : 0); @@ -19926,9 +19928,10 @@ void packetdb_loaddb(void) { memset(packet_db,0,sizeof(packet_db)); #define packet(id, size, ...) packetdb_addpacket((id), (size), ##__VA_ARGS__, 0xFFFF) -#define packetKeys(a,b,c) do { clif->cryptKey[0] = (a); clif->cryptKey[1] = (b); clif->cryptKey[2] = (c); } while(0) #include "packets.h" /* load structure data */ #undef packet +#define packetKeys(a,b,c) do { clif->cryptKey[0] = (a); clif->cryptKey[1] = (b); clif->cryptKey[2] = (c); } while(0) +#include "packets_keys.h" #undef packetKeys } void clif_bc_ready(void) { |