Events bug fixed.

This commit is contained in:
Vatiken 2012-08-15 02:48:41 +00:00
parent 620adcc8bb
commit cabfb3013e
3 changed files with 21 additions and 0 deletions

View file

@ -976,6 +976,7 @@ void extract_char_final(struct char_data *ch)
void extract_char(struct char_data *ch)
{
char_from_furniture(ch);
clear_char_event_list(ch);
if (IS_NPC(ch))
SET_BIT_AR(MOB_FLAGS(ch), MOB_NOTDEADYET);

View file

@ -172,3 +172,22 @@ struct mud_event_data * char_has_mud_event(struct char_data * ch, event_id iId)
return NULL;
}
void clear_char_event_list(struct char_data * ch)
{
struct event * pEvent;
if (ch->events == NULL)
return;
if (ch->events->iSize == 0)
return;
simple_list(NULL);
while ((pEvent = (struct event *) simple_list(ch->events)) != NULL) {
event_cancel(pEvent);
}
simple_list(NULL);
}

View file

@ -49,6 +49,7 @@ struct mud_event_data *new_mud_event(event_id iId, void *pStruct, char *sVariabl
void attach_mud_event(struct mud_event_data *pMudEvent, long time);
void free_mud_event(struct mud_event_data *pMudEvent);
struct mud_event_data * char_has_mud_event(struct char_data * ch, event_id iId);
void clear_char_event_list(struct char_data * ch);
/* Events */
EVENTFUNC(event_countdown);