Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found error on Converted a bunch of packets to structs (#8295) #8325

Closed
Beginerxx opened this issue May 11, 2024 · 1 comment
Closed

Found error on Converted a bunch of packets to structs (#8295) #8325

Beginerxx opened this issue May 11, 2024 · 1 comment
Labels
component:core A fault that lies within the main framework of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode type:bug Issue that is a bug within rAthena

Comments

@Beginerxx
Copy link

rAthena Hash

d445497

Client Date

20230906

Server Mode

Renewal

Result

Hi i have a problem After update from clif.cpp

Error + mes_length

clif.cpp(2641,53): warning C4267: '=': conversion from 'size_t' to 'int16', possible loss of data

Thank you.


`void clif_scriptmenu( map_session_data& sd, uint32 npcid, const char* mes ){
struct block_list *bl = nullptr;

if (!sd.state.using_fake_npc && (npcid == fake_nd->bl.id || ((bl = map_id2bl(npcid)) && (bl->m!=sd.bl.m ||
   bl->x<sd.bl.x-AREA_SIZE-1 || bl->x>sd.bl.x+AREA_SIZE+1 ||
   bl->y<sd.bl.y-AREA_SIZE-1 || bl->y>sd.bl.y+AREA_SIZE+1))))
   clif_sendfakenpc( sd, npcid );

PACKET_ZC_MENU_LIST *packet = reinterpret_cast<PACKET_ZC_MENU_LIST*>(packet_buffer);

size_t mes_length = strlen(mes);
packet->packetType = HEADER_ZC_MENU_LIST;
packet->npcId = npcid;
packet->packetLength = sizeof(PACKET_ZC_MENU_LIST) + mes_length;
memcpy(packet->menu, mes, mes_length);

clif_send( packet, packet->packetLength, &sd.bl, SELF );

}`

Screenshot 2024-05-11 184222

Relevant Log Output

Error + mes_length

clif.cpp(2641,53): warning C4267: '=': conversion from 'size_t' to 'int16', possible loss of data

Expected Result

How to Reproduce

Official Information

Modifications that may affect results

@Beginerxx Beginerxx added the type:bug Issue that is a bug within rAthena label May 11, 2024
@kaninhot004
Copy link
Contributor

Could be same problem as #8321 ?

@Lemongrass3110 Lemongrass3110 added component:core A fault that lies within the main framework of rAthena mode:renewal A fault that exists within the renewal mode mode:prerenewal A fault that exists within the pre-renewal mode labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:core A fault that lies within the main framework of rAthena mode:prerenewal A fault that exists within the pre-renewal mode mode:renewal A fault that exists within the renewal mode type:bug Issue that is a bug within rAthena
Projects
None yet
Development

No branches or pull requests

3 participants