Re: [CODING] Fight System Crash, in act.offensive

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 12/11/01


On Wed, 12 Dec 2001, Chi Hue wrote:

> [... snip ...]

First things first, read the Mailing List FAQ guidelines for rules on
properly formatting your messages.  Specifically, wrap lines at 79
characters.

> --snip of act.offensive.c , in do_hit()

What's num_attacking set to when it's not a gun?

Don't you want to end the loop when the player dies?

What is the victim set to for non-guns?

WHat is it set to for guns?

>  if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {

Why would you want the victim NOT equal to the person the character is
fighting?

>   while (num_attacking > 0)

You're going to want to prevent shooting dead people...

...someone already wrote something about your use of WAIT_STATE.  There's
probably much more to be said, but such problems with loops in the fight
code have been addressed countless times before.  Check the archives.

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



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