Re: [OasisOLC] Bug Reports

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


From: "Mythran" <kip_potter@HOTMAIL.COM>
> > 2. Should Room Room Flags like Atrium, OLC and * be setable? if not why
> not
> > forbid it?
>
> Good point, I might add another flag for those flags that allows the admin
> to set which flags can be set and which can not...or maybe just hard code
> it... hmmm

Actually the old readme gives a warning about this. Originally this was by
design, to make it possible to alter _everything_ in a world file.

If you decide to limit it, I'd suggest you do it something like this,
to make it easier to alter. After all, oasis.h has to be altered anyway,
if you add new room flags, affect flags, etc.

oasis.h:

  #define NUM_ROOM_FLAGS   16
  #define NUM_ROOM_SECTORS 10
+  #define OASIS_ROOM_NOSET  (ROOM_HOUSE | ROOM_HOUSE_CRASH |\
+                     ROOM_ATRIUM | ROOM_OLC | ROOM_BFS_MARK )

  #define NUM_MOB_FLAGS  18
  #define NUM_AFF_FLAGS  22
  #define NUM_ATTACK_TYPES 15
+  #define OASIS_AFF_NOSET (AFF_BLIND | AFF_GROUP | AFF_POISON | AFF_SLEEP)

redit.c: (case REDIT_FLAGS)

    else {
      /*
       * Toggle the bit.
       */
+      if (IS_SET(OASIS_ROOM_NOSET, 1 << (number - 1))) {
+       write_to_output(d, "Can't set that, sorry.\r\n");
+        /* remove it in case it was set before. */
+        REMOVE_BIT(OLC_ROOM(d)->room_flags, 1 << (number - 1));
+      } else
        TOGGLE_BIT(OLC_ROOM(d)->room_flags, 1 << (number - 1));
      redit_disp_flag_menu(d);
    }
    return;


medit.c:

  case MEDIT_AFF_FLAGS:
    if ((i = atoi(arg)) <= 0)
      break;
    else if (i <= NUM_AFF_FLAGS)
+    {
+      if (IS_SET(OASIS_AFF_NOSET, 1 << (i - 1))) {
+       write_to_output(d, "Can't set that, sorry.\r\n");
+        /* remove it in case it was set before. */
+        REMOVE_BIT(AFF_FLAGS(OLC_MOB(d)), 1 << (i - 1));
+      } else
        TOGGLE_BIT(AFF_FLAGS(OLC_MOB(d)), 1 << (i - 1));
+    }
    medit_disp_aff_flags(d);
    return;

oedit.c:

  case OEDIT_PERM:
    if ((number = atoi(arg)) == 0)
      break;
    if (number > 0 && number <= NUM_AFF_FLAGS)
+    {
+      if (IS_SET(OASIS_AFF_NOSET, 1 << (number - 1))) {
+       write_to_output(d, "Can't set that, sorry.\r\n");
+        /* remove it in case it was set before. */
+        REMOVE_BIT(GET_OBJ_PERM(OLC_OBJ(d)), 1 << (number - 1));
+      } else
        TOGGLE_BIT(GET_OBJ_PERM(OLC_OBJ(d)), 1 << (number - 1));
+    }
    oedit_disp_perm_menu(d);
    return;

Note: this is not tested. All in my head and everything.

Welcor

--
   +---------------------------------------------------------------+
   | 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/26/03 PDT