[Newbie] [CircleWin95] [CODE] look_at_target crashes MUD and computer

From: JWoodsIII (JWoodsIII@AOL.COM)
Date: 05/03/98


[WIN95] [MSVC++ 5.0]

My MUD crashes everytime I look at mobs, objects, players, and [maybe]
directions and extra descriptions. Then after I wade through the error
messages, my computer screws up royally with the same message in blue, dos GPF
form.

Here's what happened.

I typed LOOK PUFF, where Puff was mob #1 in stock Circle.
I debugged and I got the following:

In the disassembly window, a yellow arrow pointed to:
0043BED1   movsx       edx,byte ptr [ecx]


In the variables window, it showed:
this    CXX0017: Error: symbol "this" not found


On the debug tab of the Output window, it had the following errors:

Loaded 'C:\MPRPG\CIRCLMUD\CIRCLE30\circle.exe', no matching symbolic
information found.
Loaded 'C:\WINDOWS\SYSTEM\WSOCK32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM\URL.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\SHLWAPI.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM\SHELL32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM\COMCTL32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\GDI32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\ADVAPI32.DLL', no matching symbolic information
found.
Loaded 'C:\WINDOWS\SYSTEM\KERNEL32.DLL', no matching symbolic information
found.


And when I first tried to debug, it gave me some sort of error message similar
to:

Unhandled exception at 0x000000005 [or some similar number of 0s] in
Circle.exe.


Here is the code in look_at_target.
*snip*

void look_at_target(struct char_data * ch, char *arg)
{
  int bits, found = 0, j;
  struct char_data *found_char = NULL;
  struct obj_data *obj = NULL, *found_obj = NULL;
  char *desc;

  if (!ch->desc)
    return;

  if (!*arg) {
    send_to_char("I don't see that here!\r\n", ch);
    return;
  }
  bits = generic_find(arg, FIND_OBJ_INV | FIND_OBJ_ROOM | FIND_OBJ_EQUIP |
                      FIND_CHAR_ROOM, ch, &found_char, &found_obj);

  /* Is the target a character? */
  if (found_char != NULL) {
    look_at_char(found_char, ch);
    if (ch != found_char) {
      if (CAN_SEE(found_char, ch))
        act("$n looks at you.", TRUE, ch, 0, found_char, TO_VICT);
      act("$n looks at $N.", TRUE, ch, 0, found_char, TO_NOTVICT);
    }
    return;
  }
  /* Does the argument match an extra desc in the room? */
  if ((desc = find_exdesc(arg, world[ch->in_room].ex_description)) != NULL) {
    page_string(ch->desc, desc, 0);
    return;
  }
  /* Does the argument match an extra desc in the char's equipment? */
  for (j = 0; j < NUM_WEARS && !found; j++)
    if (GET_EQ(ch, j) && CAN_SEE_OBJ(ch, GET_EQ(ch, j)))
      if ((desc = find_exdesc(arg, GET_EQ(ch, j)->ex_description)) != NULL) {
        send_to_char(desc, ch);
        found = 1;
      }
  /* Does the argument match an extra desc in the char's inventory? */
  for (obj = ch->carrying; obj && !found; obj = obj->next_content) {
    if (CAN_SEE_OBJ(ch, obj))
        if ((desc = find_exdesc(arg, obj->ex_description)) != NULL) {
        send_to_char(desc, ch);
        found = 1;
      }
  }

  /* Does the argument match an extra desc of an object in the room? */
  for (obj = world[ch->in_room].contents; obj && !found; obj =
obj->next_content)
    if (CAN_SEE_OBJ(ch, obj))
        if ((desc = find_exdesc(arg, obj->ex_description)) != NULL) {
        send_to_char(desc, ch);
        found = 1;
      }
  if (bits) {                   /* If an object was found back in
                                 * generic_find */
    if (!found)
      show_obj_to_char(found_obj, ch, 5);       /* Show no-description */
    else
      show_obj_to_char(found_obj, ch, 6);       /* Find hum, glow etc */
  } else if (!found)
    send_to_char("I can't find the object you're looking for.\r\n", ch);
}

*snip*
I haven't touched this code at all. Does anyone know what's wrong? Sorry to
spam the list.

Thanks,
-JW
Your MUD name here.
localhost 4000


     +------------------------------------------------------------+
     | 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