Patch #7

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


From: emitchel@sol.UVic.CA (Elise Zaranski)

 Hi, just wanted to let you know I found another little FIGHTING(ch)
related bug. When as an immort you initiate an attack on a MOB, and
then use goto to get out of battle, and immediately try to leave in
any direction (not by goto), you get the message No way, you're fighting!
you are allowed to leave after one MUD pulse, which means that the
fighting pointer is not updated immediately upon change but rather with
every pulse, this could cause possible problems.
--- 8< --- 8< ---

This fix seems most appropriate in char_to_room().

diff -upr stk/handler.c 21/handler.c
--- stk/handler.c       Mon Mar 30 23:41:39 1998
+++ 21/handler.c        Sat Jun  6 19:43:25 1998
@@ -403,6 +403,12 @@ void char_to_room(struct char_data * ch,
       if (GET_OBJ_TYPE(GET_EQ(ch, WEAR_LIGHT)) == ITEM_LIGHT)
        if (GET_OBJ_VAL(GET_EQ(ch, WEAR_LIGHT), 2))     /* Light ON */
          world[room].light++;
+
+    /* Stop fighting now, if we left. */
+    if (FIGHTING(ch) && IN_ROOM(ch) != IN_ROOM(FIGHTING(ch))) {
+      stop_fighting(FIGHTING(ch));
+      stop_fighting(ch);
+    }
   }
 }

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/          | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- 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