static patrolchannel *patrolchannels;
static void patroluserhandler(nick *np, int event, void **args) {
- /* Nothing to do here. */
+ patrolchannel *pc;
+
+ if (event == LU_KILLED) {
+ for (pc = patrolchannels; pc; pc = pc->next) {
+ if (pc->nick == np) {
+ pc->nick = NULL;
+ break;
+ }
+ }
+ }
}
static void pc_check(void) {
if (ircd_strcmp(pc->channel->content, name) == 0) {
freesstring(pc->channel);
- deregisterlocaluser(pc->nick, NULL);
+
+ if (pc->nick)
+ deregisterlocaluser(pc->nick, NULL);
*pnext = pc->next;
free(pc);