Re: Chown

From: AFCervo (chrisf@PTDPROLOG.NET)
Date: 08/08/97


On Fri, 8 Aug 1997, Crimson Wizard wrote:

> Changed it already *sheepish grin*
>
> ACMD(do_chown)
> {
>   struct char_data *victim;
>   struct obj_data *obj = NULL; /* add this */
>
>   two_arguments(argument, buf, buf2);
>
>   if (!*buf)
>     send_to_char("Syntax: chown <object> <character>.\r\n", ch);
>   else if (!(victim = get_char_vis(ch, buf2)))
>     send_to_char("No one by that name here.\r\n", ch);
>   else if (victim == ch)
>     send_to_char("Are you sure you're feeling ok?\r\n", ch);
>   else if (GET_LEVEL(victim) >= GET_LEVEL(ch))
>     send_to_char("That's really not such a good idea.\r\n", ch);
>   else if (!*buf2)
>     send_to_char("Syntax: chown <object> <character>.\r\n", ch);
>   else {
>     act("$n makes a gesture and $p flies from $N to $m.",
>           FALSE,ch,0,0,TO_ROOM);
the act is okay, but you still need to add the object to it and the guy
your swiping it from.
>     send_to_char("You make a gesture and $p flies from $N to you.\r\n", ch);
>     send_to_char("$N makes a gesture and $p flies from you to $m.\r\n", victim);    obj_from_char(obj);

      Right here above, you are using #n and things, which are format
strings that are made to be used with act, and only with act, with
send_to_char...
 >     obj_to_char(obj, ch);
>   }
> }
>

also where are you getting the object from?  it doesn't magically appear
from thin air, you'll have to go to the target character's inventory,
and equipment and make sure obj points ti it before you do object from
character, or object to character.  Currently there is a mess inside it
because it isn't even initialized to NULL, so there is no telling what the
OS put into it.  setting it to NULL makes it NULL, so at least it is
predictable, but without finding the pointer to it in the inventory it is
like saying take NULL off of the character and give it to the immortal.
You need some sort of object.  Also keep in mind that $n $p $N are for act
only, they don't work in send_to_char.......

BTW: Nice name I like chown :)  cheers to you....

Keep up the good work


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



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