From 81d05eb8a7afdd02c31dd209c855583a99b70175 Mon Sep 17 00:00:00 2001 From: adam- Date: Thu, 16 Jul 2009 09:01:01 +0000 Subject: [PATCH] Initialize botinfo->flags on bot creation to fix some database problems git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2381 5417fbe8-f217-4b02-8779-1006273d7864 --- src/bots.cpp | 2 ++ src/botserv.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bots.cpp b/src/bots.cpp index a46726122..a5184a847 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -20,6 +20,7 @@ BotInfo::BotInfo(const char *nnick) insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. nbots++; this->cmdTable = NULL; + this->flags = 0; if (s_ChanServ && !stricmp(s_ChanServ, nnick)) this->flags |= BI_CHANSERV; @@ -48,6 +49,7 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const insert_bot(this); // XXX, this is ugly, but it needs to stay until hashing of bots is redone in STL. nbots++; this->cmdTable = NULL; + this->flags = 0; if (s_ChanServ && !stricmp(s_ChanServ, nnick)) this->flags |= BI_CHANSERV; diff --git a/src/botserv.c b/src/botserv.c index c3c63735d..285fc9e9b 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -507,7 +507,7 @@ void load_bs_dbase() SAFE(read_string(&bi->real, f)); if (ver >= 10) { SAFE(read_int16(&tmp16, f)); - bi->flags = tmp16; + bi->flags |= tmp16; } SAFE(read_int32(&tmp32, f)); bi->created = tmp32;