Fixed a display problem in refine UI (#6535)
Fixes #6528 Thanks to @idk-whoami, @zdurexz @secretdataz
This commit is contained in:
parent
9d324ba077
commit
9ccdfe9d17
@ -22115,27 +22115,18 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<s_refine_level_info> info = refine_db.findLevelInfo( *id, *item );
|
struct PACKET_ZC_REFINE_ADD_ITEM* p = (struct PACKET_ZC_REFINE_ADD_ITEM*)packet_buffer;
|
||||||
|
|
||||||
// No refine possible
|
|
||||||
if( info == nullptr ){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// No possibilities were found
|
|
||||||
if( info->costs.empty() ){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16 length = (uint16)( sizeof( struct PACKET_ZC_REFINE_ADD_ITEM ) + REFINE_COST_MAX * sizeof( struct PACKET_ZC_REFINE_ADD_ITEM_SUB ) );
|
|
||||||
|
|
||||||
// Preallocate the size
|
|
||||||
WFIFOHEAD( fd, length );
|
|
||||||
|
|
||||||
struct PACKET_ZC_REFINE_ADD_ITEM* p = (struct PACKET_ZC_REFINE_ADD_ITEM*)WFIFOP( fd, 0 );
|
|
||||||
|
|
||||||
p->packetType = HEADER_ZC_REFINE_ADD_ITEM;
|
p->packetType = HEADER_ZC_REFINE_ADD_ITEM;
|
||||||
|
p->packtLength = sizeof( struct PACKET_ZC_REFINE_ADD_ITEM );
|
||||||
p->itemIndex = client_index( index );
|
p->itemIndex = client_index( index );
|
||||||
|
|
||||||
|
std::shared_ptr<s_refine_level_info> info = refine_db.findLevelInfo( *id, *item );
|
||||||
|
|
||||||
|
// No possibilities were found
|
||||||
|
if( info == nullptr ){
|
||||||
|
p->blacksmithBlessing = 0;
|
||||||
|
}else{
|
||||||
p->blacksmithBlessing = (uint8)info->blessing_amount;
|
p->blacksmithBlessing = (uint8)info->blessing_amount;
|
||||||
|
|
||||||
uint16 count = 0;
|
uint16 count = 0;
|
||||||
@ -22147,13 +22138,13 @@ void clif_refineui_info( struct map_session_data* sd, uint16 index ){
|
|||||||
p->req[count].itemId = client_nameid( cost->nameid );
|
p->req[count].itemId = client_nameid( cost->nameid );
|
||||||
p->req[count].chance = (uint8)( cost->chance / 100 );
|
p->req[count].chance = (uint8)( cost->chance / 100 );
|
||||||
p->req[count].zeny = cost->zeny;
|
p->req[count].zeny = cost->zeny;
|
||||||
|
p->packtLength += sizeof( struct PACKET_ZC_REFINE_ADD_ITEM_SUB );
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
p->packtLength = (uint16)( sizeof( struct PACKET_ZC_REFINE_ADD_ITEM ) + count * sizeof( struct PACKET_ZC_REFINE_ADD_ITEM_SUB ) );
|
clif_send( p, p->packtLength, &sd->bl, SELF );
|
||||||
|
|
||||||
WFIFOSET( fd, p->packtLength );
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user