Re: [CODING] Spec Proc bug...

From: Chuck Reed (master@i-55.com)
Date: 12/12/98


Hah, yeah I guess I could read your problem well before spouting off
answeres, heh.  Ok, lemme re-try this.

It sounds like the *ch pointer being passed to this spec is equal to the PC
and not the mob.  How does this spec proc fire?  If a player does something
to case the spec to fire, then *ch != the mob.  The best way to re-write
this would be:

SPECIAL(wacky_teleporting_mob)
{
  struct char_data *mob = (struct char_data *) me;
  struct char_data *vict;
  static round;
  static max_rounds;

  vict = FIGHTING(mob);
  if(!vict || vict == mob) // Invalid target or mob fighting itself
    return FALSE;

  if(max_rounds == 0)
    max_rounds = number(3,6);

  if ((GET_POS(mob) == POS_FIGHTING)) {
    if(round < max_rounds) {               {
      round++;
      return FALSE;
     }
    else {
      send_to_char("\r\nI like pink bunny slippers!\r\n", vict);
      round = 0;
      max_rounds = 0;
      char_from_room(vict);
      char_to_room(vict, real_room(30004));
      look_at_room(vict, 0);
     }
} else {
    round = 0;
    max_rounds = 0;
    act("Some special room action is done here.... :)", FALSE, ch, 0, 0,
TO_ROOM);
   }

 return FALSE;
}


     +------------------------------------------------------------+
     | 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