Re: Question about Multi attack

From: OpusDPen (opusdpen@LAVA.NET)
Date: 07/11/97


-----BEGIN PGP SIGNED MESSAGE-----

On 11 Jul 97 at 20:00, Heartless wrote:

> >From the snippet site (thanks to Absolut Mud, I think (what a bunch of
> swell fellows :))), I got this:
>
>         if((GET_SKILL(ch, SKILL_SECOND) > 0)) {
>            if(GET_SKILL(ch, SKILL_SECOND) > number(1,200)-5*GET_LEVEL(ch))
>               if(FIGHTING(ch));
>                  hit(ch,FIGHTING(ch),TYPE_UNDEFINED);
>         }
>
> In the third line (if(FIGHTING(ch));) there be a semi colon.  now i'm not
> to well versed in c, but wouldn't you not want that semicolon to be there?
> Someone write back and tell me how dumb i am :)
>
Well, as a C programmer that is not the only problem I see.  The semicolon is
valid but it would seem from the indentation not what was intended.  The other
problems may not be big issues depending on the complexity of the code.  How
much time do GET_SKILL() and FIGHTING() take to complete?

    if ((temp = GET_SKILL(ch, SKILL_SECOND)) > 0) {
      if (temp > number(1,200)-5*GET_LEVEL(ch))
        if (temp = FIGHTING(ch))
          hit(ch,temp,TYPE_UNDEFINED);
    }

This may be harder to read but it will speed up the code.  Just my opinion...
:)

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAgUBM8ah63Dae2odWWzpAQFMPgP+Jd+mdSoxGWApDqOFNhBBMKrf/tqasMyB
nZQ04tYrHgIdYEt/y+IjWgpLaRAd0le/m2ng52WK5vNtOusL+QFkrbPOBWHS+ijv
VRzAB/7gNsjQk3L1laD9rA476lQtccGxLI9xR+SAoC3nCffVK6zft0267Ux/O8x8
9RlA+oAMdLc=
=XOJH
-----END PGP SIGNATURE-----

-Opus-
I am an idealist. I don't know where I am going
but I'm on my way.
                            -Carl Sandburg
"Whatever you do will be insignificant,
but it is very important that you do it."
                            -Mahatma Gandhi
--------------------------------------------------------
Home Page at http://www.lava.net/~opusdpen/
Public PGP Key ID = 0x1D596CE9 (1024 bit key)
For Humor list:mailto:opusdpen@lava.net?subject=ADD_HUMOR


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