Re: Sedit Problem (Possible fixes to two problems)

From: Del (
Date: 07/29/01

On Sat, 28 Jul 2001, Timbrewolf wrote:
> To recreate the crash error, use sedit.  *grin*  Okay, for my test to make
> sure it wasn't just my code, I downloaded Circle3.0 bpl18 and Oasis 2.0
> (also tried with 2.01) and patched it in.  No other patches.
> Go into sedit for a shop (you can use a standard midgaard shop), change the
> shopkeeper (even to the same one), change a couple things (product list,
> etc. you can use the same info) and exit.

Problem 1
sedit save to disk saves two shop bits as ascii and db.c doesn't like it.
(in genshp.c)
-      sprintascii(buf1, S_BITVECTOR(shop));
-      sprintascii(buf2, S_NOTRADE(shop));
              S_NOITEM1(shop) ? S_NOITEM1(shop) : "%s Ke?!",
              S_NOITEM2(shop) ? S_NOITEM2(shop) : "%s Ke?!",
              S_NOBUY(shop) ? S_NOBUY(shop) : "%s Ke?!",
              S_NOCASH1(shop) ? S_NOCASH1(shop) : "%s Ke?!",
              S_NOCASH2(shop) ? S_NOCASH2(shop) : "%s Ke?!",
              S_BUY(shop) ? S_BUY(shop) : "%s Ke?! %d?",
              S_SELL(shop) ? S_SELL(shop) : "%s Ke?! %d?",
-             buf1,
+              S_BITVECTOR(shop),
-             buf2
+              S_NOTRADE(shop)

Second problem (Thanks for the help Geoff!)

If you edit a shop and select 0, using the same mob number or a mob that
already has a func set as shop_keeper, it apparently causes the shop.c
fuction SPECIAL(shop_keeper) to loop with this bit of code.

  if (SHOP_FUNC(shop_nr)) {     /* Check secondary function */
    if ((SHOP_FUNC(shop_nr)) (ch, me, cmd, arg))
      return (TRUE);

Since I don't fully understand it, those more experinced would know more,
but in sedit.c where you set the shopkeeper's func, it sets the shop's
function to shop_keeper. This is becuase the mob already has a func
of shop_keeper. I don't know if this is correct to do so, but
it seems to work for me. ANY real help on how this should be

+    mob_index[i].func = NULL;
    S_FUNC(OLC_SHOP(d)) = mob_index[i].func;
    mob_index[i].func = shop_keeper;

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST