Silver and copper snippet

Posted by Gadush on Mon 09 Feb 2004 04:14 AM — 4 posts, 18,698 views.

#0
Hi folks.
I am trying to implement a snippet that changes the money system to use silver and copper as well as gold. I'm sure I cut and pasted everything just as instructed, but when I compile I get this error:

In act_obj.c in function do_auction
Too few arguments in function show_list_to_char

The error shows line 2779, which I have noted below. The entire old do_auction function was
replaced by a new do_auction from the snippet, and this is a segment surrounding the area in
question. Can anyone see what is wrong?


case ITEM_ARMOR:
		  sprintf( buf, "Armor class is %d.\n\r", obj->value[0] );
		  send_to_char( buf, ch );
		  break;
	    }

	    for ( paf = obj->pIndexData->first_affect; paf; paf = paf->next )
		showaffect( ch, paf );

	    for ( paf = obj->first_affect; paf; paf = paf->next )
		showaffect( ch, paf );
	    if ( ( obj->item_type == ITEM_CONTAINER || obj->item_type == ITEM_KEYRING
	    ||     obj->item_type == ITEM_QUIVER)   && obj->first_content )
	    {
		set_char_color( AT_OBJECT, ch );
		send_to_char( "Contents:\n\r", ch );
 line 2779:     show_list_to_char( obj->first_content, ch, TRUE, FALSE );
	    }

	    if (IS_IMMORTAL(ch))
	    {
		sprintf(buf, "Seller: %s.  Bidder: %s.  Round: %d.\n\r",
                        auction->seller->name, auction->buyer->name,
                        (auction->going + 1));
		send_to_char(buf, ch);
		sprintf(buf, "Time left in round: %d.\n\r", auction->pulse);
		send_to_char(buf, ch);
	    }
            return;
    


I looked at the top of the file, where show_list_to_char is declared. It looks like:

void show_list_to_char args( ( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing,
   const int iDefaultAction ));


Here is the beginning of the do_auction function:
 
   /* put items up for auction */
void do_auction (CHAR_DATA *ch, char *argument)
{
    OBJ_DATA *obj;
    char arg1[MAX_INPUT_LENGTH];
    char arg2[MAX_INPUT_LENGTH];
    char arg3[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    int i;
    int gbid = 0;
    int sbid = 0;
    int cbid = 0;
    int tmpvalue = 0;

    argument = one_argument (argument, arg1);
    argument = one_argument (argument, arg2);
    argument = one_argument (argument, arg3);    
    

Thanks for any help in advance,
Gadush
Canada #1
The problem here is this:
Quote:
show_list_to_char( obj->first_content, ch, TRUE, FALSE );

void show_list_to_char args( ( OBJ_DATA *list, CHAR_DATA *ch, bool fShort, bool fShowNothing,
const int iDefaultAction ));


If you count them, there are 5 arguments needed for show_list_to_char:
  1. list
  2. ch
  3. fshort
  4. fshownothing
  5. idefaultaction
You are only passing 4 arguments in your call, you have to add the fifth, something like:
show_list_to_char( obj->first_content, ch, TRUE, FALSE, 0 );
You'd have to look up how the fifth variable affects the function.

Hope that helps.
#2
Any future help you may need on this snippet I might be able to hook you up with. This seems to be the same snippet I'm currently beating the crap outta in my code. Working on getting it work right with my bank snippet so the banks read copper and silver too.

-Toy
#3
Thanks for the help. I looked at the original function, and added eItemBid back into that expression, and that worked.
Copper and Silver, and Gold. Oh my. Thanks a lot for the help.
Gadush