summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c73
1 files changed, 41 insertions, 32 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 414884394..c1e7cb1c9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -611,7 +611,7 @@ void clif_authok(struct map_session_data *sd)
p.xSize = p.ySize = 5; /* not-used */
#if PACKETVER >= 20080102
- p.font = sd->user_font; // FIXME: Font is currently not saved.
+ p.font = sd->status.font;
#endif
clif->send(&p,sizeof(p),&sd->bl,SELF);
@@ -982,7 +982,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
p.state = vd->dead_sit;
p.clevel = clif_setlevel(bl);
#if PACKETVER >= 20080102
- p.font = (sd) ? sd->user_font : 0;
+ p.font = (sd) ? sd->status.font : 0;
#endif
#if PACKETVER >= 20140000 //actual 20120221
if( bl->type == BL_MOB ) {
@@ -1110,7 +1110,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
p.xSize = p.ySize = (sd) ? 5 : 0;
p.clevel = clif_setlevel(bl);
#if PACKETVER >= 20080102
- p.font = (sd) ? sd->user_font : 0;
+ p.font = (sd) ? sd->status.font : 0;
#endif
#if PACKETVER >= 20140000 //actual 20120221
if( bl->type == BL_MOB ) {
@@ -1188,7 +1188,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
p.xSize = p.ySize = (sd) ? 5 : 0;
p.clevel = clif_setlevel(bl);
#if PACKETVER >= 20080102
- p.font = (sd) ? sd->user_font : 0;
+ p.font = (sd) ? sd->status.font : 0;
#endif
#if PACKETVER >= 20140000 //actual 20120221
if( bl->type == BL_MOB ) {
@@ -2459,40 +2459,49 @@ void clif_equiplist(struct map_session_data *sd) {
}
void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length) {
- int i, normal = 0, equip = 0;
+ int i = 0;
struct item_data *id;
- for( i = 0; i < items_length; i++ ) {
-
- if( items[i].nameid <= 0 )
- continue;
-
- id = itemdb->search(items[i].nameid);
- if( !itemdb->isstackable2(id) ) //Non-stackable (Equippable)
- clif_item_equip(i+1,&storelist_equip.list[equip++],&items[i],id,id->equip);
- else //Stackable (Normal)
- clif_item_normal(i+1,&storelist_normal.list[normal++],&items[i],id);
- }
+ do {
+ int normal = 0, equip = 0, k = 0;
+
+ for( ; i < items_length && k < 500; i++, k++ ) {
+
+ if( items[i].nameid <= 0 )
+ continue;
+
+ id = itemdb->search(items[i].nameid);
+
+ if( !itemdb->isstackable2(id) ) //Non-stackable (Equippable)
+ clif_item_equip(i+1,&storelist_equip.list[equip++],&items[i],id,id->equip);
+ else //Stackable (Normal)
+ clif_item_normal(i+1,&storelist_normal.list[normal++],&items[i],id);
+ }
- if( normal ) {
- storelist_normal.PacketType = storagelistnormalType;
- storelist_normal.PacketLength = ( sizeof( storelist_normal ) - ARRAYLENGTH( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal);
+ if( normal ) {
+ storelist_normal.PacketType = storagelistnormalType;
+ storelist_normal.PacketLength = ( sizeof( storelist_normal ) - sizeof( storelist_normal.list ) ) + (sizeof(struct NORMALITEM_INFO) * normal);
+
#if PACKETVER >= 20120925
- safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH);
-#endif
- clif->send(&storelist_normal, storelist_normal.PacketLength, &sd->bl, SELF);
- }
-
- if( equip ) {
- storelist_equip.PacketType = storagelistequipType;
- storelist_equip.PacketLength = ( sizeof( storelist_equip ) - ARRAYLENGTH( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip);
+ safestrncpy(storelist_normal.name, "Storage", NAME_LENGTH);
+#endif
+
+ clif->send(&storelist_normal, storelist_normal.PacketLength, &sd->bl, SELF);
+ }
+
+ if( equip ) {
+ storelist_equip.PacketType = storagelistequipType;
+ storelist_equip.PacketLength = ( sizeof( storelist_equip ) - sizeof( storelist_equip.list ) ) + (sizeof(struct EQUIPITEM_INFO) * equip);
#if PACKETVER >= 20120925
- safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH);
+ safestrncpy(storelist_equip.name, "Storage", NAME_LENGTH);
#endif
+
+ clif->send(&storelist_equip, storelist_equip.PacketLength, &sd->bl, SELF);
+ }
- clif->send(&storelist_equip, storelist_equip.PacketLength, &sd->bl, SELF);
- }
+ } while ( i < items_length );
+
}
void clif_cartlist(struct map_session_data *sd) {
@@ -8885,7 +8894,7 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
}
viewequip_list.PacketType = viewequipackType;
- viewequip_list.PacketLength = ( sizeof( viewequip_list ) - ARRAYLENGTH( viewequip_list.list ) ) + ( sizeof(struct EQUIPITEM_INFO) * equip );
+ viewequip_list.PacketLength = ( sizeof( viewequip_list ) - sizeof( viewequip_list.list ) ) + ( sizeof(struct EQUIPITEM_INFO) * equip );
safestrncpy(viewequip_list.characterName, tsd->status.name, NAME_LENGTH);
@@ -16092,7 +16101,7 @@ void clif_font(struct map_session_data *sd)
nullpo_retv(sd);
WBUFW(buf,0) = 0x2ef;
WBUFL(buf,2) = sd->bl.id;
- WBUFW(buf,6) = sd->user_font;
+ WBUFW(buf,6) = sd->status.font;
clif->send(buf, packet_len(0x2ef), &sd->bl, AREA);
#endif
}