RE: [Circle] Code Stopping multiple instantiation

From: Wade Hovind (WHovind@epsb.edmonton.ab.ca)
Date: 08/12/96


How do I toggle the state of a static variable on zreset?

SPECIAL(foo)
{
        static char loaded=0
        if(CMD_IS("somethingcool")) {
                if(loaded)
                        return 0;
                do_something_cool();
                loaded=1;
                return 1;
        }
        return 0
}

OR
you can assign the special to an object and load it in a zone with no   
zone
reset.  When you trigger the special, remove the object.

/Berzerk

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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