shops and specs bug

From: Kras Kresh (
Date: 05/01/02

i was installing my own version of mob progs to allow builders access to
specs. these specs are assigned as the mobs are parsed. I noticed that i
forgot to include shops to be saved as a spec in the mob file. the mud
started crashing after that. actually, the story is somewhat different, but
it should produce the same results. so i took a look in shop.c
SPECIAL(shop_keeper) and assign_the_shopkeepers(). i saw that on assigning,
the shops save the previous spec and do a call to it in
SPECIAL(shop_keeper). so now we have a recursive call to shop_keeper().
who knows, a newbie programmer might want to make a shop and do a spec
assign to a shop in spec_assign.c.

anyway, my change seems to have stopped the crashing - on the test mud
haven't crashed it on the game port with the mob procs yet =)

  char argm[MAX_INPUT_LENGTH];
  struct char_data *keeper = (struct char_data *) me;
  int shop_nr;

  for (shop_nr = 0; shop_nr <= top_shop; shop_nr++)
    if (SHOP_KEEPER(shop_nr) == keeper->nr)

  if (shop_nr > top_shop)
    return (FALSE);

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

i'm suggesting a change of to:

  if (SHOP_FUNC(shop_nr) && SHOP_FUNC(shop_nr) != *this)       /* Check
secondary function */
    if ((SHOP_FUNC(shop_nr)) (ch, me, cmd, arg))
      return (TRUE);

MSN Photos is the easiest way to share and print your photos:

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT