Re: About OasisOLC/medit

From: Adam Beytin (mbeytin@UMD5.UMD.EDU)
Date: 07/12/97


> medit (of OasisOLC) crashes when you try to save mobs.  This is
> undesirable :).  I found one post at the archive saying that medit
> couldn't deal with NULL fields, but even after I made sure all the fields
> were filled, medit still crashed.

Run with gdb, I've heard of two problems with that function (I had one of
them).  First, the free(mob_index); line...  Wait, I just figured out what
the problem with that line is.  When a new mob is created and you try to
free it's index, you free a non-existing index.  Maybe put a check if it
is a new mob before that line and you'll fix it.., I don't have that
problem with my version, so I won't even try.
Anyhow, if that is what the problem is, just comment it out.  But it might
cause a memory leak, not sure.
If that's not the problem, then it could be a problem with checking the
SHOP_KEEPER(shop) list.  I think this problem only happens if you have no
existing shops.  You should put it in anyway, just in case.  At the lines:

    for (shop = 0; shop <= top_shop; shop++)
      if (SHOP_KEEPER(shop) > new_mob_num)
        SHOP_KEEPER(shop)++;

Just put

    if (top_shop)
      for (shop = 0; shop <= top_shop; shop++)
        if (SHOP_KEEPER(shop) > new_mob_num)
          SHOP_KEEPER(shop)++;

in place of them.
A simple fix, but it fixed my problem.  Try those, if it doesn't work,
figure it out.


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