wearable ITEM_BOAT items

From: Jason Fischer (jasonf@u.washington.edu)
Date: 05/19/95


woah... got quite a few responses to repost the fix that i had sent along 
that fixes it so that you can wear ITEM_BOAT items and go through water 
rooms.

so i thought i'd post it to the list as well as sending it along to those 
who had mailed me =)

btw, this version of the code was modified from what i had first sent to 
the list thanks to the input from the list (thanks to those who sent 
along those ideas)

-- this goes in act.movement.c
you'll need to change: 
int was_in, need_movement, has_boat = 0;
to 
int was_in, need_movement, has_boat = 0, equip_pos;
at the top of do_simple_move

begin excerpt
-------------
/* if this room or the one we're going to needs a boat, check for one */
  if ((world[ch->in_room].sector_type == SECT_WATER_NOSWIM) ||
      (world[EXIT(ch, dir)->to_room].sector_type == SECT_WATER_NOSWIM)) {
    for (obj = ch->carrying; obj; obj = obj->next_content)
      if (GET_OBJ_TYPE(obj) == ITEM_BOAT)
        has_boat = TRUE;

/* added to check through worn equipment for a boat item */
    if (!has_boat)
      for (equip_pos = 0; equip_pos < NUM_WEARS; equip_pos++)
        if (GET_OBJ_TYPE(ch->equipment[equip_pos]) == ITEM_BOAT)
          has_boat = TRUE;

    if (!has_boat) {
      send_to_char("You need a boat to go there.\r\n", ch);
      return 0;

-----------
end excerpt

well, that SHOULD do it, but as with all things that i code caveat emptor =)

jason

--
Jason Fischer                         Intel: big brother inside.  
jasonf@u.washington.edu                                    
      "in the shadow of the light from a black sun" Type O-                   



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