Re: Transportation devices

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 08/30/98


On Fri, 28 Aug 1998, Phillip A. Ames wrote:

> Okie all, sorry to bring this back up, but having gotten the beamup
> function of this to work, I'm trying to add in a beamdown one that will
> send them back to the room they beamed up from.  However, I'm having a
> bit of trouble.  What happens is below...
>
> 32000H/32000H 32000M/32000M 32000V/32000V > wear all
> You wear a test communicator badge as a communicator badge.
>
> 32000H/32000H 32000M/32000M 32000V/32000V > beamup
> Sorry, but you cannot do that here!
>
> 32000H/32000H 32000M/32000M 32000V/32000V > beamdown
> You must be wearing a communicator to use any of it's functions!
>
> ... And the code...
>
>
> if (!GET_EQ(ch, WEAR_COMM) && CMD_IS("beamup") || CMD_IS("beamdown")) {
>     send_to_char("You must be wearing a communicator to use any of it's
> functions!\r\n", ch);
>     return 1;
>   }
> if (!CMD_IS("beamup") || !CMD_IS("beamdown") ){
>         return 0;
> }

This is messy.  Since you're only proceeding if we're using "beamup" or
"beamdown", we can clean this code up quickly.  Also, be careful with your
logical ands and ors.  You want, "if the command isn't beamup and it isn't
beamdown," not what you have.

(Oh, and minor point of no real significance: there's no apostrophe in the
possessive form of it in order to distinguish it from the contraction it
is [so it's "its functions"]).

  if (!CMD_IS("beamup") && !CMD_IS("beamdown"))
    return 0;
  if (!GET_EQ(ch, WEAR_COMM)) {
    send_to_char("You must be using a communicator badge to use any of"
                 "its functions.\r\n", ch);
    return 1;
  }

> Can anyone see any reason why this may be happening?

If you have any more problems, just keep sending them along.

-dak


     +------------------------------------------------------------+
     | 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/15/00 PST