Problem with act()

From: Christoffer Lundberg (avatar@stargate.orion.boden.se)
Date: 11/30/99


I have added a virtual map to my MUD. Now, there is only one slight
problem with controlling the act's that are sent out when you perform
certain things. I've tried all kinds of possible solutions, but neither
of them work.

This is how the act() code looks like where I want to be able to control
who receives what when the act calls TO_NOTVICT or TO_ROOM.

---SNIPPET---

  if (ch && ch->in_room != NOWHERE)
    to = world[ch->in_room].people;
  else if (obj && obj->in_room != NOWHERE)
    to = world[obj->in_room].people;
  else {
    log("SYSERR: no valid target to act()!");
    return;
  }
  to2 = world[ch->in_room].listening;

  for (; to; to = to->next_in_room)
     if (SENDOK(to) && !(hide_invisible && ch && !CAN_SEE(to, ch)) &&
         (to != ch) && (type == TO_ROOM || (to != vict_obj)) &&
         (!IS_AFFECTED(ch, AFF_HALF_SANC) && !IS_AFFECTED(to,
AFF_HALF_SANC)))
        perform_act(str, ch, obj, vict_obj, to);

  for (; to2; to2 = to2->next_listener)
    if (SENDOK(to2) && !(hide_invisible && ch && !CAN_SEE(to2, ch)) &&
        (to2 != ch) && (type == TO_ROOM || (to2 != vict_obj)) &&
        (!IS_AFFECTED(ch, AFF_HALF_SANC) && !IS_AFFECTED(to2,
AFF_HALF_SANC)))
      perform_act(str, ch, obj, vict_obj, to2);

    MOBTrigger = TRUE;

---SNIPPET---

Now, I need to add a check that checks GET_X(ch) == GET_X(to...) and
GET_Y(ch) == GET_Y(to...). Both X and Y are int's.

How can I do this? (sorry for the long post)

()CHRISTOFFER:>......


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