Re: zone flag checks

From: John (witpens@optushome.com.au)
Date: 04/20/02


Scott the brain dead scribbled:-
> I try to set up a check in act.movement.c
>
> going like this
>
> if (GET_LEVEL(ch) >= LVL_IMMORT && GET_LEVEL(ch) < LVL_BUILDER) {
>      IF (ZONE_FLAGGED(EXIT(ch, dir)->to_room), ZONE_QUEST)) {
>         send_to_char(" Your not allowed in there!\r\n",  ch)
>         return (0);
>    }
> }
>
> It always crashes on the EXIT(ch, dir)->to_room


You are right, it will crash exactly at this spot. You might want to see
if the pointer exists before you dereference it.

ie. add somewhere above, if (EXIT(ch, dir)) before you do the
ZONE_FLAGGED

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT