X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/7b862ba07440f280852c909f2cde73b35a3eb031..21b22dceca9d89abfa607419c4289b9eacf84a2f:/patrol/patrol_commands.c diff --git a/patrol/patrol_commands.c b/patrol/patrol_commands.c index 4bbf5e75..d4cd6a5f 100644 --- a/patrol/patrol_commands.c +++ b/patrol/patrol_commands.c @@ -17,7 +17,16 @@ typedef struct patrolchannel { 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) { @@ -81,7 +90,9 @@ static int pc_part(char *name) { 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);