generic_find/TAR_OBJ_EQUIP

From: George (greerga@CIRCLEMUD.ORG)
Date: 12/01/97


Firstly, could TAR_OBJ_EQUIP not use generic_find?

Well, anyway, here's the fix for the previously reported problem:

diff -uprN -x *.o ../stk/handler.c ./handler.c
--- ../stk/handler.c    Wed Oct 29 00:16:25 1997
+++ ./handler.c Mon Dec  1 21:52:50 1997
@@ -1174,7 +1174,8 @@ int generic_find(char *arg, int bitvecto
   }
   if (IS_SET(bitvector, FIND_OBJ_EQUIP)) {
     for (found = FALSE, i = 0; i < NUM_WEARS && !found; i++)
-      if (GET_EQ(ch, i) && isname(name, GET_EQ(ch, i)->name)) {
+      if (GET_EQ(ch, i) && CAN_SEE_OBJ(ch, GET_EQ(ch, i)) &&
+                                       isname(name, GET_EQ(ch, i)->name))
{
        *tar_obj = GET_EQ(ch, i);
        found = TRUE;
       }
diff -uprN -x *.o ../stk/spell_parser.c ./spell_parser.c
--- ../stk/spell_parser.c       Wed Oct 29 00:16:29 1997
+++ ./spell_parser.c    Mon Dec  1 21:55:05 1997
@@ -672,7 +672,8 @@ ACMD(do_cast)

     if (!target && IS_SET(SINFO.targets, TAR_OBJ_EQUIP)) {
       for (i = 0; !target && i < NUM_WEARS; i++)
-       if (GET_EQ(ch, i) && isname(t, GET_EQ(ch, i)->name)) {
+       if (GET_EQ(ch, i) && CAN_SEE_OBJ(ch, GET_EQ(ch, i)) &&
+                                       isname(t, GET_EQ(ch, i)->name)) {
          tobj = GET_EQ(ch, i);
          target = TRUE;
        }

I have tested it and it works.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


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