circle30bpl19dgolc.tar.gz errors

From: Carlos Myers (farix@stargate.net)
Date: 10/05/01


I was just looking through circle30bpl19dgolc.tar.gz to find out what I left
out in my own patch of OLC and DG Scripts when I noticed three errors.  The
first two errors deal deal with get_obj_in_equip_vis.

The prototype for get_obj_in_equip_vis is as follows:

struct obj_data *get_obj_in_equip_vis(struct char_data *ch, char *arg, int
*number, struct obj_data *equipment[]);

From patch level 18:

struct obj_data *get_object_in_equip_vis(struct char_data *ch, char *arg,
struct obj_data *equipment[], int *j);

Whoever put this this together since patch level 18 thought that the 'j'
argument (equipment position) in the old get_object_in_equip_vis was the
same as number from get_obj_in_equip_vis.  While I'm still confused as to
exactly what number does, it definitely does not contain the equipment
position of the object being returned.

The patch below should fix the errors in the code in dg_mobcmb.c and
dg_scripts.c.

Carlos

diff -upwNB src/dg_mobcmd.c DG+OLC/dg_mobcmd.c
--- src/dg_mobcmd.c Sun Sep  9 16:01:48 2001
+++ DG+OLC/dg_mobcmd.c Sat Sep 22 23:23:14 2001
@@ -200,9 +199,8 @@ ACMD(do_mjunk)
     if (!str_cmp(arg, "all")) junk_all = 1;

     if ((find_all_dots(arg) != FIND_INDIV) && !junk_all) {
- if ((obj=get_obj_in_equip_vis(ch,arg,&pos,ch->equipment))!= NULL) {
-     unequip_char(ch, pos);
-     extract_obj(obj);
+ if ((pos = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) >= 0) {
+     extract_obj(unequip_char(ch, pos));
      return;
  }
  if ((obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)) != NULL )


@@ -215,11 +213,8 @@ ACMD(do_mjunk)
   extract_obj(obj);
      }
  }
- while ((obj=get_obj_in_equip_vis(ch,arg,&pos,ch->equipment)))
- {
-     unequip_char(ch, pos);
-     extract_obj(obj);
- }
+ while ((pos = get_obj_pos_in_equip_vis(ch, arg, NULL, ch->equipment)) >=
0)
+     extract_obj(unequip_char(ch, pos));
     }
     return;
 }
diff -upwNB src/dg_scripts.c DG+OLC/dg_scripts.c
--- src/dg_scripts.c Sun Sep  9 16:08:02 2001
+++ DG+OLC/dg_scripts.c Sat Sep 22 23:31:08 2001
@@ -908,7 +908,6 @@ ACMD(do_detach)
   struct room_data *room;
   char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH],
arg3[MAX_INPUT_LENGTH];
   char *trigger = 0;
-  int tmp;

   argument = two_arguments(argument, arg1, arg2);
   one_argument(argument, arg3);
@@ -958,7 +957,7 @@ ACMD(do_detach)
         trigger = arg3;
     }
     else  {
-      if ((object = get_obj_in_equip_vis(ch, arg1, &tmp, ch->equipment)));
+      if ((object = get_obj_in_equip_vis(ch, arg1, NULL, ch->equipment)));
       else if ((object = get_obj_in_list_vis(ch, arg1, NULL,
ch->carrying)));
       else if ((victim = get_char_room_vis(ch, arg1, NULL)));
       else if ((object = get_obj_in_list_vis(ch, arg1, NULL,
world[IN_ROOM(ch)].contents)));

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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