Welcome to the Builder Academy

Question Whirlwind Bug?

More
14 Aug 2012 17:25 #673 by zusuk
Whirlwind Bug? was created by zusuk
To replicate the bug, whirlwind and die... make sure you are still whirlwinding when you die.

I think that the event is trying to run while you aren't playing... so the fix is:

[in event_whirlwind, act.offensive.c]
/* For the sake of simplicity, we will place the event data in easily
* referenced pointers */
pMudEvent = (struct mud_event_data *) event_obj;
ch = (struct char_data *) pMudEvent->pStruct;

if (!IS_PLAYING(ch->desc)) <
you'll need this
return 0; <
and this :P

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
15 Aug 2012 02:50 #676 by Vatiken
Replied by Vatiken on topic Re: Whirlwind Bug?
The crash was being caused by attempting to cycle through the character's room after he was killed, the bug has been fixed. Thanks for that catch.
Code:
Index: handler.c =================================================================== --- handler.c (revision 324) +++ handler.c (working copy) @@ -976,6 +976,7 @@ 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); Index: mud_event.c =================================================================== --- mud_event.c (revision 324) +++ mud_event.c (working copy) @@ -172,3 +172,22 @@ 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); +} Index: mud_event.h =================================================================== --- mud_event.h (revision 324) +++ mud_event.h (working copy) @@ -49,6 +49,7 @@ 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);

tbaMUD developer/programmer
The following user(s) said Thank You: zusuk, Freeman

Please Log in or Create an account to join the conversation.

Time to create page: 0.173 seconds