Re: [Help] Events

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 01/15/98


At 01:48 PM 1/15/98 +0100, you wrote:
> What I need pointers for is where to put the clean_event call for
>the character who is searching, so as to stop just that search event
>for that character, not something more drastic like stopping all
>characters searching ....

You might try having a unique "control block" being the causer, rather
than ch, and run clean_events() on that... some pseudo code, assuming
you have a player descripter value for the search control block:

struct event_control_block {
  struct char_data *ch;
  whatever else you might need;
};

.....
do_search() {
    struct event_control_block *ecb;

    if (GET_SEARCH_EVENT(ch))
        return; /* they're already searching */

    ecb = malloc(...);
    ecb->ch = ch;
    GET_SEARCH_EVENT(ch) = ecb;
    add_event(ecb,.....,event_do_search);
}

.....

EVENT(event_do_search)
{
....
.... free(GET_SEARCH_EVENT(causer->ch));
}


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