Jump to content
  • 0

Please ask someone knowledgeable to help answer this.


darksam

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  04/04/19
  • Last Seen:  

Does anyone know how to fix the code?

clif.cpp:25552:25: error: invalid use of ‘const_cast’ with type ‘int’, which is not a pointer, reference, nor a pointer-to-data-member type
25552 |         p->expireTime = const_cast<int>((st->expire_time - time(NULL)) * 1000); //if 0 == unlimited on client..
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clif.cpp:25567:78: error: invalid initialization of non-const reference of type ‘item&’ from an rvalue of type ‘item*’
25567 |                         clif_add_random_options( p->items[slot].option_data, &st->items_inventory[i] );
      |                                                                              ^~~~~~~~~~~~~~~~~~~~~~~
clif.cpp:2794:93: note: in passing argument 2 of ‘void clif_add_random_options(ItemOptions*, item&)’
 2794 | static void clif_add_random_options( struct ItemOptions buf[MAX_ITEM_RDM_OPT], struct item& it ){

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  03/19/23
  • Last Seen:  

This looks like some custom code. i don't see the same code on rAthena master branch.

for the 1st error you can try removing const_cast<int>, for the 2nd error remove & from the line.
I cannot tell if my suggestion will work, because i don't have the full info. Provide more information i.e. the source code of the modified functions you added if you still need help.

but imo you'd get quicker result asking Chatgpt

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