Re: [Circle] [NEWBIE] Looking up Real Zone number

From: Daniel Koepke (dkoepke@california.com)
Date: 11/30/96


On Sat, 30 Nov 1996, Nic Suzor wrote:

> oops, sorry, i made a mistake here, what im looking for is a check to make
> sure the mobile being forced is part of the zone, not the room in which
> they are in.
> 
> so it should be: if(mobile is not part of zone = get_zone_permission(ch))

Assuming 'get_zone_permission()' is a zone number, you can multiply that
by one hundred and check have something like:

  int zone = get_zone_permission(ch);
  if (GET_MOB_VNUM(mob) < zone*100 && GET_MOB_VNUM > zone_table[zone].top)
  { send_to_char("That mob is not part of this zone.\r\n", ch);
    return;
  }

You could do something like

  if (GET_MOB_VNUM(mob)/100 != get_zone_permission(ch))
  { send_to_char("That mob is not part of this zone.\r\n", ch);
    return;
  }

but it's quite possible that zone 24 has mob 2500 in it since nothing
is preventing zones from having more than one hundred rooms, objects,
or mobiles.  Either way should work, though, as long as you don't have
zones with more than 100 used vnums.


--
Daniel Koepke
dkoepke@california.com
Forgive me father, for I am sin.


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