Re: Issue, confusion and general aggravation with ZONE_FLAGGED

From: Thomas Arp (t_arp@stofanet.dk)
Date: 09/04/02


From: "Mathew Earle Reuther" <graymere@zipcon.net>
To: <CIRCLE@post.queensu.ca>
Sent: Wednesday, September 04, 2002 11:45 AM
Subject: Re: [CIRCLE] Issue, confusion and general aggravation with
ZONE_FLAGGED


> On Wed, 4 Sep 2002, Thomas Arp wrote:
>
> > You can easily make the bit unavailable to people under a specific
level,
> > if you wished. I'll stop pressing the point, though.
>
> I don't know about "easily", but I'll take a stab at it some time.  The
> thought had occurred to me, I'm just not entirely sure where to put a
> check in.
>
I figure you parse input in zedit_parse: [1]

/*-------------------------------------------------------------------*/
  case ZEDIT_ZONE_FLAGS:

    number = atoi(arg);
    if ((number < 0) || (number > NUM_ZONE_FLAGS)) {
      send_to_char("That is not a valid choice!\r\n", d->character);
      zedit_disp_flag_menu(d);
    } else if (number == 0) {
      zedit_disp_menu(d);
      break;
    } else {
+      if ((1<<(number-1)) == ZONE_CLOSED && GET_LEVEL(d->character) <
LVL_GRGOD)
+        send_to_char("Only Grgods+ can open and close zones!\r\n",
d->character);
+      else {
        TOGGLE_BIT(OLC_ZONE(d)->zone_flags, 1 << (number - 1));
        OLC_ZONE(d)->number = 1;
+      }
      zedit_disp_flag_menu(d);
    }
    return;

  break;

Welcor


[1] This isn't a contrived example. The code above is used on a running
    mud, except for the lines marked with +.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT