Jump to content
  • 0

Error 'size_t' to 'int16'


Outlook

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.04
  • Content Count:  64
  • Reputation:   5
  • Joined:  07/10/22
  • Last Seen:  

Posted (edited)

Hi i have a problem After update from

https://github.com/rathena/rathena/commit/d445497870e7f93abab3800b18acc438f7a4af75

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.png

Edited by Outlook
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.04
  • Content Count:  64
  • Reputation:   5
  • Joined:  07/10/22
  • Last Seen:  

Solved.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...