[Circle] Re: OasisOLC, creating a new zone. + rlist()

From: Rasmus 'Con' Ronlev (raro94ab@hp4.econ.cbs.dk)
Date: 08/09/96


Hi all.
I recently patched my OasisOLC from version 1.0 (I think :) to 1.2 by
hand, I'm quite positive I got all the different changes fixed, and stuff
like that.

My question concerns using OasisOLC to make a new zone. 'zedit new <znum>'
In my case it's zone 10 I want to make. I've got zones 9 and 11 arround
it btw. The creation of the zone performs allright, I can create
mobs/rooms/etc, but when I use a homebrewed version of a roomlist code I
get WIERD results untill I reboot the game.

the rlist command takes an argument defining which zone I want to view the
rooms in. prior to setting up zone 10, if I type rlist 9 and rlist 11 i
get the respective zones rooms listed.
After installing the new zone using the command 'zedit new 10' the
following happens:

All zones from 0-9 show up correctly when using rlist, but typing rlist 10
gives me the list of rooms in zone 11! in fact what happens is that each
zone is 'pushed' down one, so it 'covers' zone 10. The rest of the mud
seems to work right and stuff. but I'm still out in the dark.
What i mean is:
having zones 5,6,9,11,12,15,18 results in the follwoing beeing shown using
rlist:
rlist 5 -> 5
rlist 6 -> 6
rlist 9 -> 9
rlist 10 -> 11
rlist 11 -> 12
rlist 12 -> 15
rlist 15 -> 18
rlist 18, getting a zone doesnt exist warning. This means that I can't get
zone 10 to be listed, and that every zone above zone 10 is decremented by
one in some wierd sense.

Any help/comments appreciated.
The rlist() code is above this point:

ACMD(do_rlist)		/* List rooms in a zone */
{
  int zone = -1, number = -1, found = 0, i, door;
  char *direction[] = { "N", "E", "S", "W", "U", "D" };
  char buff[16000];

  if(IS_NPC(ch))
    return;

  if(!GET_OLC_PERMISSION(ch) && GET_LEVEL(ch) < LVL_IMPL)
  {
    send_to_char("\r\nYou do not have access to OLC!\r\n", ch);
    return;
  }

  skip_spaces(&argument);

  if (!isdigit(*argument) && *argument)
  {
    sprintf(buff, "%s%s\r\nYou must enter a zone number!%s\r\n",
                  CCBRED(ch, C_NRM), CCBLINK(ch, C_NRM), CCNRM(ch, C_NRM));
    send_to_char(buff, ch);
   return;
  }

  if(*argument)
    number = atoi(argument);

  if(number < 0)
    number = world[ch->in_room].number;
  else
    number *= 100;

  for (i = 0; i < top_of_zone_table; i++)
  {
    if ((number >= (zone_table[i].number * 100)) && (number <= zone_table[i].top))
      zone = i;
  }

  if (zone < 0)		/* Invalid or no zone */
  {
    sprintf(buff, "%s%s\r\nThe entered zone number was invalid!%s\r\n",
                  CCBRED(ch, C_NRM), CCBLINK(ch, C_NRM), CCNRM(ch, C_NRM));
    send_to_char(buff, ch);
    return;
  }

  sprintf(buff, "\r\n%sList of rooms in zone: %s\r\n",
                CCYEL(ch, C_NRM), CCNRM(ch, C_NRM));

  for (i = 0; i < top_of_world; i++)
  {
    if (world[i].zone == zone)
    {
      found = 1;
      sprintf(buff, "%s%s[%s%5d%s]%s %-30s%s", buff, CCGRN(ch, C_NRM),
                   CCBLU(ch, C_NRM), world[i].number, CCGRN(ch, C_NRM),
                   CCMAG(ch, C_NRM), world[i].name, CCNRM(ch, C_NRM));

      for(door = 0; door < NUM_OF_DIRS; door++)
      {
        if(world[i].dir_option[door] &&
           world[i].dir_option[door]->to_room != NOWHERE)
        {
          sprintf(buff, "%s %s%s%s: %s%d%s", buff, CCGRN(ch, C_NRM),
          direction[door], CCNRM(ch, C_NRM), CCCYN(ch, C_NRM),
          world[((world[i].dir_option[door])->to_room)].number,
          CCNRM(ch, C_NRM));
        }
      }
      strcat(buff, "\r\n");

    }
  }
  if (!found)
    sprintf(buff, "%s%s%sNONE!!%s", buff, CCRED(ch, C_NRM), CCBLINK(ch, C_NRM),
                 CCNRM(ch, C_NRM));

  strcat(buff, "\r\n");
  page_string(ch->desc, buff, 1);
}


d.
--
     Rasmus Rønlev DOEK'94      WWW: http://www.econ.cbs.dk/people/raro94ab
     Student instructor         MUD: exiled.mud.circlemud.org 5000
                                         199.199.16.100 5000
       Student, B.Sc in Computer Science and Business Administration.

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



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