[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Silver and copper snippet

Silver and copper snippet

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Gadush   (92 posts)  [Biography] bio
Date Mon 09 Feb 2004 04:14 AM (UTC)
Message
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Mon 09 Feb 2004 06:22 AM (UTC)
Message
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.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Toy   (206 posts)  [Biography] bio
Date Reply #2 on Mon 09 Feb 2004 07:12 AM (UTC)
Message
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

It's always good to know how far you are willing to go to be the best...

Karl Mancine
aka
Toy the Dark Puppet
[Go to top] top

Posted by Gadush   (92 posts)  [Biography] bio
Date Reply #3 on Mon 09 Feb 2004 11:28 AM (UTC)
Message
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
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,172 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]