[CODE] [NEWBIE] do_look crashing MUD! :-(

From: JWoodsIII (JWoodsIII@AOL.COM)
Date: 04/29/98


I'm using circle code that is only slightly modified, and I haven't touched
do_look. However, whenever someone tries to LOOK <direction/obj/mob/player> it
crashes the game. They can still use LOOK without arguments, but when they
look at something kapow. I have no idea what I've done. :-(

Here's the code...sorry if it doesn't do the linefeeds quite right, AOL
doesn't like the kind VC++ 5.0 uses.
*snip*
ACMD(do_look){  static char arg2[MAX_INPUT_LENGTH];  int look_type;  if
(!ch->desc)    return;  if (GET_POS(ch) < POS_SLEEPING)    send_to_char("You
can't see anything but stars!\r\n", ch);  else if (IS_AFFECTED(ch, AFF_BLIND))
send_to_char("You can't see a damned thing, you're blind! (BUG!)\r\n", ch);
else if (IS_DARK(ch->in_room) && !CAN_SEE_IN_DARK(ch)) {    send_to_char("It's
too dark to see anything!\r\n", ch);
list_char_to_char(world[ch->in_room].people, ch);       /* glowing red eyes */  }
else {    half_chop(argument, arg, arg2);    if (subcmd == SCMD_READ) {
if (!*arg)      send_to_char("Read what?\r\n", ch);      else   look_at_target(ch,
arg);      return;    }    if (!*arg)                   /* "look" alone, without an argument
at all */      look_at_room(ch, 1);    else if (is_abbrev(arg, "in"))
look_in_obj(ch, arg2);    /* did the char type 'look <direction>?' */    else
if ((look_type = search_block(arg, dirs, FALSE)) >= 0)
look_in_direction(ch, look_type);    else if (is_abbrev(arg, "at"))
look_at_target(ch, arg2);    else      look_at_target(ch, arg);  }}
*snip*

Thanks,
-JW


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