Jump to content
  • 0
Sign in to follow this  
Lord Ganja

get rid of less than overcharged selling price warning

Question

Okay, I intentionally added an item with less than overcharged selling price.

Now I was thinking if I can get rid of the warnings that appear by adding the item id to the source so it won't show the warning even if these 'ids' are less than overcharged selling price.

 

For example, if I set the id 607 less than overcharged selling price. I'll add the id 607 to the src so the warning won't appear.

 

 ' if( type == SHOP && value*0.75 < id->value_sell*1.24 && itemid != 607) { <== This is just my idea for excluding items id's.

 

 

How do I do that? :hmm:  Thanks in advance.

 

 

this is the part in npc.c 

if( type == SHOP && value*0.75 < id->value_sell*1.24 ) {	// Exploit possible: you can buy and sell back with profit	ShowWarning("npc_parse_shop: Item %s [%d] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) in file '%s', line '%d'.n",		id->name, nameid, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));	if (retval) *retval = EXIT_FAILURE;}

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

This is not good code practice but here's how you do it

if( type == SHOP && value*0.75 < id->value_sell*1.24 && nameid != 607 ) {    // Exploit possible: you can buy and sell back with profit    ShowWarning("npc_parse_shop: Item %s [%d] discounted buying price (%d->%d) is less than overcharged selling price (%d->%d) in file '%s', line '%d'.n",        id->name, nameid, value, (int)(value*0.75), id->value_sell, (int)(id->value_sell*1.24), filepath, strline(buffer,start-buffer));    if (retval) *retval = EXIT_FAILURE;}

notice the && nameid != 607

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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