Re: [CODE] ACMD(do_sheath)

From: Daniel Koepke (
Date: 01/28/97

On Tue, 28 Jan 1997, Leonard Burns IV wrote:

>     else
>       obj_to_char(unequip_char(ch, 16), ch);   // THIS IS THE PROBLEM

Well, you know it's the problem.  Here's what's wrong (it's really
quite simple).  perform_wear is going to make sure you don't wear
something over what you already have worn.  In order to do this, it
checks GET_EQ(ch, WEAR_SHEATH) as you passed it.  Your code, however,
to remove the obj and put it into the inventory of the player does
not do this.  BTW, it might be better to not use perform_wear() and
just do it the longer way.  Still, here's the fix for what you have
below (I think, anyway):

  else if (GET_EQ(ch, WEAR_SHEATH)) {
    send_to_char("You already have something in your belt.\r\n", ch);
  } else {
    obj_to_char(unequip_char(ch, WEAR_SHEATH), ch);

Replace the elipses (uh, periods for those of you that don't know your
punctuation marks so well) with the proper arguments for perform_wear...
Don't remember them.

Daniel Koepke
Forgive me father, for I am sin.

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   |

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