Re: [CODE] re:spec_proc invis_item

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 11/13/97

I have a minor issue with your code. As written, the specproc may only
work with a single object (vnum 35) although it is of course possible
to ASSIGNOBJ() to multiple objects. Of course you can say "if I add a
new object, I just check for it's vnum too". Yes, this will work but it
is not clean. Instead of checking the vnum, just check to see if the
object has a specproc == invis_item.

Here's how i did just that in an object specproc:


  /* make sure the object found has this as a specproc */
  if (obj_index[obj->item_number].func != handgrenade) {
    /* this is the wrong object */
    do whatever

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST