a bug with water sectors?

From: Jason Fischer (jasonf@u.washington.edu)
Date: 04/12/95


One of my friends pointed this out to me, and i thought that perhaps it 
might have been a small over sight in the boat checking code.  As it is now,
you can only use a boat item if you are carrying it.  Which sort of 
nullifies the reason behind items like the seashell ring (vnum 2543) and the 
plain boots (vnum 909) (which are worn ITEM_BOAT) included in the stock 
CircleMUD world.

so i hacked up the boat checking part of act.movement.c.  So far i 
haven't noticed anything wrong with it, but still caveat emptor =)

from act.movement.c
-----------------------------------------------------------------------------
int do_simple_move(struct char_data * ch, int dir, int need_specials_check)
{
  int was_in, need_movement, has_boat = 0;
  struct obj_data *obj;

  int check_eq = 1;  /* added this */
  int equip_pos;     /* and this   */

  int special(struct char_data * ch, int cmd, char *arg);

  /*
   * Check for special routines (North is 1 in command list, but 0 here) Note
   * -- only check if following; this avoids 'double spec-proc' bug
   */
  if (need_specials_check && special(ch, dir + 1, ""))
    return 0;

  /* charmed? */
  if (IS_AFFECTED(ch, AFF_CHARM) && ch->master && ch->in_room == ch->master->in_room) {
    send_to_char("The thought of leaving your master makes you weep.\r\n", ch);
    act("$n bursts into tears.", FALSE, ch, 0, 0, TO_ROOM);
    return 0;
  }
/* 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;  
	check_eq = FALSE;  /* added this so it won't check the worn equipment */
      }	                   /* if a boat is found in the inventory */

    if (!has_boat && check_eq == TRUE) 			  /* added from here */	
      for (equip_pos = 0; equip_pos < NUM_WEARS; equip_pos++)
        if (GET_OBJ_TYPE(ch->equipment[equip_pos]) == ITEM_BOAT)
          has_boat = TRUE;                                /* to here */ 
        
    if (!has_boat) {
      send_to_char("You need a boat to go there.\r\n", ch);
      return 0;
    }  
  }
end excerpt
----------------------------------------------------------------------------

and now back to your regularly scheduled program,
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