Re: Multi-attack

From: Sammy (samedi@clark.net)
Date: 10/28/96


On Mon, 28 Oct 1996 MAALEXAN@am.pnu.com wrote:

- RH Green writes:
- 
- >I have just installed the snippet that does multi attacks. But when a 
- >monster is close to death the mud crashes when it is hit repeatedly ?? any 
- >ideas how to avoid this ??? Sorry about hasseling you.
- 
- This happened to me too.  I wrote a routine that calculated the number of 
- attacks one obtained as a function of haste/slow and multi-attack status.  
- It then called hit from fight.c the requested number of times.  The routine 
- worked fine until the mob died when the mud crashed.
- 
- According to gdb termination occurred at this line in the hit function in 
- fight.c:
- 
-   if (ch->in_room != victim->in_room) {
-     if (FIGHTING(ch) && FIGHTING(ch) == victim)
-       stop_fighting(ch);

When victim dies, it's extracted with extract_char(victim).  Once that
happens, any more attacks will crash the mud when you try to access
victim->in_room.  You need a check to make sure victim is a non-null
value.

Sam

+-----------------------------------------------------------+
| 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/18/00 PST