targeting worn object bug

From: Kras Kresh (
Date: 04/18/01

This is a pl18 bug, so ignore this if you are not using it.
I seemed to have fixed the bug in which you can't do remove #.item.
Also, this also seems to fix the do_stat bug in which if you want to
stat something with the same alias as the object you wear, you only
get the first one. The fix provided to me by George Greer for the stat bug
didn't fix it but I'll include it because it looks right. If anyone can
improve on my code please send me a copy.

act.wizard.c: in ACMD(do_stat):
int tmp;

and also delete:
if ((object = get_object_in_equip_vis(ch, buf1, ch->equipment, &tmp)) !=

replace with:
if ((object = get_object_in_equip_vis(ch, buf1, ch->equipment, &number)) !=

that was George Greer's.

This is mine, but make a check if you find the bug in your game:
act.item.c: in ACMD(do_remove):
at the end right after the else add:
char *name = arg;
i = get_number(&name);

handler.c: struct obj_data *get_object_in_equip_vis():
replace function with:
struct obj_data *get_object_in_equip_vis(struct char_data * ch, char *arg,
struct obj_data *equipment[], int *j)
  int cnt;
  if ((*j) < 0)
    return (NULL);

  for (cnt = 0; (*j) > 0 && cnt < NUM_WEARS; cnt++)
    if (equipment[cnt] && CAN_SEE_OBJ(ch, equipment[cnt]))
      if (isname(arg, equipment[cnt]->name)) {
        if ((*j) == 1) {
          (*j) = cnt;        /* I use this for the remove function */
          return (equipment[cnt]);
        (*j)--;     /* this should be fine for stat shouldn't it? */
      }             /*
  return (NULL);
Get your FREE download of MSN Explorer at

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/05/01 PST