Re: Dig/Bury command problems

From: Bodega (bodega@PETSTORE.TELEC.COM)
Date: 07/10/97


On Thu, 10 Jul 1997, Michael B. Schlagenhauf wrote:

> items.  What happens is that a user can dig anywhere and they'll turn up
> items that are buried in other zones that are still being written.  I've
> --
> Mike Schlagenhauf
> mschlag@cs.purdue.edu

I experienced the same problems with the dig command. I made a simple fix
that allows a player to dig up only one item in the room at a time (that
is if there are more than one)... this also fixed finding objects from
differnt zones problem that you have. My code has changed from the
original snippet, but I believe all that was needed to fix the problem
was a return; command...I'll post what I believe to be the fix from the
original snippet, if this doesn't work e-mail me (not the list) and I'll
try to help you out.

in do_dig:
...
while (obj != NULL) {
   if (IS_BURIED(obj)) {
      REMOVE_BIT...;
      if (CAN_SEE...) {
         found_item = 1;
         act(...);
         act(...);
         obj_from...;
         obj_to...;
         return;  <- add this
      } else {
         SET_BIT...;
      }
   }
   obj = obj->next;
}

The ...'s means I'm too lazy to type out what should be there.

Bodega

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
< Email: Bodega@petstore.telec.com                                           >
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/


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