Locate Object.

From: Patrick Dughi (dughi@imaxx.net)
Date: 02/07/99


        Was looking through the locate object spell declaration, and
noticed it said it was broken. Here's a fix, and a simple way to get
arguments to a spell w/o target, etc.

        I'm only curious why this hadn't been done before.

        Okay, in structs.h, right under last_tell (in the player_specials)
section, add the line

        *spellarg;

In utils.h, in the macros, add a define;
        #define GET_LAST_SPELL(ch)      (ch->player_specials->spellarg)

In spells.c, remove the line which reads:
        strcpy(name,fname(i->name));
                and replace it with .....
        strcpy(name,GET_LAST_SPELL(ch));

And, in spell_parser.c in the ACMD(do_cast), right under the part which
has something like..
 /* Find the target */
if(t != NULL) {
}
        Anyway, ticked away inside those if braces, preferably as the last
statement, add the line
        GET_LAST_SPELL(ch)=str_dup(t);

        Thats it.. 4 lines, you're all done.  Plus, you get to use it
later for neat spell args.... If you're curious, do cast looks for
arguments, so, you'll never have to worry about GET_SPELL_LAST(ch) being
set to NULL, as long as you say that the spell requires an argument.

                                        PjD


     +------------------------------------------------------------+
     | 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