Jump to content
  • 0
Hakuryuu

implicit declaration of function ‘itemdb_searchrandomid’

Question

problem:
 
script.c: In function ‘buildin_getstorageitem’:
script.c:17571: warning: implicit declaration of function ‘itemdb_searchrandomid’
 
code:

 

	else {		nameid = script_getnum(st,2);		if ( nameid < 0 )			nameid = itemdb_searchrandomid(-nameid);		if ( nameid <= 0 || !itemdb->exists(nameid) ) {			ShowError("getstorageitem: Non-existant item %d requested.n", nameid);			return 0;		}	} 

 

 
Please help.
Edited by samers

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

What error when you change as per AngelMelody post?

AngelMelody solution is correct , maybe some other line is having error now?

Share this post


Link to post
Share on other sites
  • 0

nameid = itemdb->searchrandomid(-nameid);

 

What error when you change as per AngelMelody post?

AngelMelody solution is correct , maybe some other line is having error now?

 

error: 

 

script.c: In function ‘buildin_getstorageitem’:script.c:17656: warning: passing argument 1 of ‘itemdb->searchrandomid’ makes pointer from integer without a castscript.c:17656: note: expected ‘struct item_group *’ but argument is of type ‘int’ 

 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.