Issues with a couple of snippets, Buildwalk and Experience

From: Mathew Earle Reuther (graymere@zipcon.net)
Date: 07/03/02


Been busy with any number of things since finishing off the DGscripts work
last week.  Mainly sorting out snippets, gathering ideas, and implementing
things (or at least versions of them) which fit into what I'm looking for.

My problem currently is with a couple of the snippets I've added.  First
I'll address the Buildwalk problem.

When in buildwalk mode it is possible to walk in an appropriate direction
(any, including the ones i added: nw, ne, sw, se, in, out) and have the
mud properly build you a new room as it should.  However, at some point it
WILL crash, and as near as I can tell it's going outside of the zone vnums
when it does so.  My problem is, I can't figure out how to make it stay
within the vnums properly . . . the way zones are handled has changed a
bit since the buildwalk snippet was released, so I had to make some
changes.  What I've currently got is below:

/****************************************************************************
* BuildWalk - OasisOLC Extension by D. Tyler Barnes
*
****************************************************************************/

/* For buildwalk. Finds the next free vnum in the zone */
room_vnum redit_find_new_vnum(zone_rnum zone) {

  room_vnum vnum;
  room_rnum rnum = real_room((vnum = zone_table[zone].number * 100));

  if (rnum != NOWHERE) {
    for(; world[rnum].number <= vnum; rnum++, vnum++)
      if ((vnum > zone_table[zone].top) || (vnum < zone_table[zone].bot))
        return(NOWHERE);
  }
  return(vnum);

}

int buildwalk(struct char_data *ch, int dir) {

  struct room_data *room;
  room_vnum vnum;
  room_rnum rnum;

  if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_BUILDWALK) &&
   GET_LEVEL(ch) >= LVL_BUILDER) {

    if (zone_table[world[ch->in_room].zone].number != GET_OLC_ZONE(ch)
     && GET_LEVEL(ch) < LVL_IMPL) {
      send_to_char(ch, "You do not have build permissions in this
zone.\r\n");
    } else if ((vnum = redit_find_new_vnum(world[ch->in_room].zone)) ==
NOWHERE)
      send_to_char(ch, "No free vnums are available in this zone!\r\n");
    else {

      /* Set up data for add_room function */
      CREATE(room, struct room_data, 1);
      room->name = strdup("New BuildWalk Room");
      sprintf(buf, "This unfinished room was created by %s.\r\n",
GET_NAME(ch));
      room->description = strdup(buf);
      room->number = vnum;
      room->zone = world[ch->in_room].zone;

      /* Add the room */
      add_room(room);

      /* Link rooms */
      CREATE(EXIT(ch, dir), struct room_direction_data, 1);
      EXIT(ch, dir)->to_room = (rnum = real_room(vnum));
      CREATE(world[rnum].dir_option[rev_dir[dir]], struct
room_direction_data, 1);
      world[rnum].dir_option[rev_dir[dir]]->to_room = ch->in_room;

      /* Memory cleanup */
      free(room->name);
      free(room->description);
      free(room);

      /* Report room creation to user */
      sprintf(buf, "%sRoom #%d created by BuildWalk.%s\r\n", CCYEL(ch,
C_SPR),
       vnum, CCNRM(ch, C_SPR));
      send_to_char(ch, buf);

      return(1);
    }

  }

  return(0);
}

Any suggestions as to how to correct my crashing issues would be
appreciated!

***

Second issue I have is that since adding the new experience system
(one of the ones based on the Nic Suzor snippet) code, I'm unable to
properly use the advance command.  It WILL adequately demote someone, at
least by a level.  However, it fails utterly in raising them, even a
single level (which I could see living with, as long as it worked!)

I'm at a complete loss as for why this is happening, and I don't even have
the slightest clue what code change caused this to occur!

Anyone with any suggestions or ideas or experience manipulating the system
to eliminate the bulky experience/title tables, please help me out?

-Mathew

--
   +---------------------------------------------------------------+
   | 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