Re: [NEWBIE][CODE][HELP] act call

From: Sean Daley (sdaley@bbnplanet.com)
Date: 02/23/99


for a description of the act function check out the documentation
that comes with CircleMUD.  Specifically in the directory

<circlemud>/doc/OLD-DOCS

you'll find a file called comm.doc which describes the act call.
In case that document is outdated, you can always look at the
act function call which is defined in comm.c.  How do I know this?
I actually took the time to go look for it myself.  It's amazing
what a person can do on their own isn't it?

void act(const char *str, int hide_invisible, struct char_data *ch,
         struct obj_data *obj, const void *vict_obj, int type)

Here is what you're passing.
act("$N pulls on the crank of the slot machine.",
         FALSE, 0, ch, 0, TO_ROOM);

Your fourth argument is ch.  act wants a variable of type struct obj_data*
as the fourth argument, hence your error.

Also, by my count.
grep act\( *.c *.h | wc -l = 470 hits (a little less than a million)
grep act\( *.h is even better revealing only two hits.
comm.h:void     perform_act(const char *orig, struct char_data ...
comm.h:void     act(const char *str, int hide_invisible, struct ...

Sean

>stands when someone pulls the lever, it works but noone sees it.  Also when
>I compile I get the following error which probably has something to do with
>this. . .
>
>In function (play_slots)
>warning: pass arg of 4 of act from invalid pointer type
>
>
>Here is my call in spec_procs.c
>
>SPECIAL(play_slots)
>{
>.
>.
>.
>act("$N pulls on the crank of the slot machine.",
>         FALSE, 0, ch, 0, TO_ROOM);
>.
>.
>.
>}
>
>If one of you know what I'm doing wrong.  Please let me know!!  :)


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST