Re: [CODING] Spec Proc bug...

From: Daniel Koepke (dkoepke@california.com)
Date: 12/12/98


CyberLord wrote:
>
> Somehow during the fight and the goto command the monster becomes
> the victim and the player becomes the ch.

In which case, I would theorize that the spec-proc is being called
incorrectly.  As it is, unless the mobile is fighting himself (which
would indicate another bug within your code), there is no way vict
can become ch.  Which must, then, mean that 'ch' is set incorrectly to
begin with, so rather than 'ch' being the NPC and 'FIGHTING(ch)'
(i.e., 'vict') being the PC, you have 'ch' as the PC, thus making
'FIGHTING(ch)' the NPC.

Acronyms and abbreviations are fun -- try reading that last sentence
aloud.

>  vict = FIGHTING(ch);
>
>  send_to_char("Blah Blah Blah...",vict);
>  act("Blah Blah Blah...", FALSE, vict, 0, 0, TO_NOTVICT);
>
>  round = 0; // reset round variables for next fight
>  max_rounds = 0; // reset max rounds variable for next fight
>
>  //move the player
>  char_from_room(vict);//remove player from current room

As an aside: static variables are ugly and dangerous.  Your code will
break if two mobiles with this spec-proc are loaded simultaneously.
Even if you aren't going to add two mobiles with this proc to your
game, one of your builders might.  I would suggest creating some
temporary variables somewhere in the mob's structure.

-dak


     +------------------------------------------------------------+
     | 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 : 12/15/00 PST