Re: Second Attack, Third Attack, and Forth Attack...

From: Chris Herringshaw (Chris.Herringshaw@med.umich.edu)
Date: 09/14/94


On Wed, 14 Sep 1994, Mathue Moyer wrote:

> Just want to point out one thing about the code quoted above that
> I suspect is an oversight on Chris's part.  Given the logic used 

Yes, and unfortunately a fatal flaw.  I slapped this together
quickly without much recent experience in DIKU.  There are 2 flaws
in what I wrote that stick out.  One is the flaw Mathue pointed
out...the second is the lack of a "continue;" after the first
attack's "else" clause.  It should look like:

} else {
  stop_fighting(ch);
  continue;
  }

You want to abort this players 2nd, 3rd, and 4th attacks if
the stop_fighting(ch) is called, or the player will start
doing things to a NULL ch->specials.fighting reference.
The continue will skip the rest of the for() loop, and move onto
the next player on the list.  At least I think it should =)

====================================================================
Christopher Herringshaw     Networking and Special Projects Division
Medical Center Information Technology (MCIT)   xxviper@med.umich.edu
University of Michigan Medical Center, B1911 CFOB
1414 Catherine Street, Ann Arbor, MI 48109-0704       (313) 747-2778
====================================================================



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