Re: purge_zone, db.c

From: Chris Jacobson (fear@ATHENET.NET)
Date: 12/05/97


On 12/5/97 3:01 PM, Angus Mezick (angus@EDGIL.CCMAIL.COMPUSERVE.COM)
stated:

>
>     2) if it is, is this line wrong or am I confused:
>           if (!ob->carried_by && !ob->in_obj && !ob->worn_by &
>     !ob->contains
>          && (world[ob->in_room].zone == zone)
>          && (!IS_SET(world[ob->in_room].room_flags, ROOM_HOUSE)))
>     extract_object(ob);
>
>     notice the single & symbol after worn_by.  that just seem wrong.

Also could be shortened to:

if ((ob->in_room != NOWHERE) && (world[ob->in_room].zone == zone) &&
          !IS_SET(ROOM_FLAGGED(ob->in_room, ROOM_HOUSE)))
     extract_object(ob);

The reason?  ob->in_room SHOULD NOT BE NOWHERE if all the other checks
pass... 'sides that it also works just in case all the other checks pass
and ob->in_room is still NOWHERE for some odd reason (obj_from_room /etc
without following obj_to call)

- Chris Jacobson


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST