Re: [Code] [snippet help] [should be simple]

From: Patrick Dughi (dughi@imaxx.net)
Date: 08/14/00


> Alrighty, I tried that.. It compiled fine, however, it gives you around 5
> seconds to try and log in before it crashes completely, basically, I had
> already done the ch->char_specials member idea, and it did the same
> thing.. I'm really not sure what's wrong with it. As for the utils.h,
> It was the only file which held any of the specials.fighting stuff,
> and I know that the code from  fight.c draws upon utils.h, that's why I
> thought there would be reason to eyeball it. =P
>

lets look at that code again;

if (AWAKE(ch) && (ch->in_room == ch->specials.fighting->in_room)) {
  hit(ch, ch->specials.fighting, TYPE_UNDEFINED);

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

  if((GET_SKILL(ch, SKILL_TRIPLE) > 0)) {
    if(GET_SKILL(ch, SKILL_TRIPLE) > number(1,200)-10*GET_LEVEL(ch))
!      if(FIGHTING(ch));
      hit(ch,FIGHTING(ch),TYPE_UNDEFINED);
  } else {
    stop_fighting(ch);
  }

--- below is probably extraneous, part of the function this snip is from--
 }
}


        Okay. first, lets look at the syntax errors.  There's two that pop
out in my head, and those are the lines with the bang before them up
above.  Why don't you remove those semicolons.  With, it will always fire
off the attack whether you're actively fighting someone or not.

        Since it will be null most of the time, that's probably a bad
thing.  Try using a debugger to trace the values sent to 'hit()'.

                                PjD


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT