Re: Shop bugs

From: George (greerga@CIRCLEMUD.ORG)
Date: 03/30/98


>From: Julian Fong <jfong@pobox.com>
>Subject: minor shop violence bug
[...]
>In ok_damage_shopkeeper in shops.c, the line:
>
>  if (IS_NPC(victim) && (mob_index[GET_MOB_RNUM(victim)].func == shop_keeper))
>
>should be changed to:
>
>  if (IS_MOB(victim) && (mob_index[GET_MOB_RNUM(victim)].func == shop_keeper))
>
>otherwise there is the chance that GET_MOB_RNUM(victim) is -1.
>
>Thus I don't think this causes a problem in stock at all, but may
>cause a problem when one extends the game to dynamically created mobs
>with rnum -1.

True enough:

diff -uprN stk/shop.c isnpcmob/shop.c
--- stk/shop.c  Wed Oct 29 00:16:28 1997
+++ isnpcmob/shop.c     Mon Mar 30 16:53:19 1998
@@ -891,7 +891,7 @@ int ok_damage_shopkeeper(struct char_dat
   char buf[200];
   int index;

-  if (IS_NPC(victim) && (mob_index[GET_MOB_RNUM(victim)].func == shop_keeper))
+  if (IS_MOB(victim) && (mob_index[GET_MOB_RNUM(victim)].func == shop_keeper))
     for (index = 0; index < top_shop; index++)
       if ((GET_MOB_RNUM(victim) == SHOP_KEEPER(index)) && !SHOP_KILL_CHARS(index)) {
        do_action(victim, GET_NAME(ch), cmd_slap, 0);

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST