X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fbots.c;fp=src%2Fbots.c;h=aaddcb705b1e34b89c1bb2dc975d98005e0b3d04;hb=ab202224a669025ff7dbf50549d7ac4a337d7fc7;hp=4875b5a5c987e97036c6084b704c2ddb58a58362;hpb=55428a9588d97fe59cbe9d1b497ec6bce0baeae5;p=NeonServV5.git diff --git a/src/bots.c b/src/bots.c index 4875b5a..aaddcb7 100644 --- a/src/bots.c +++ b/src/bots.c @@ -151,8 +151,8 @@ struct ClientSocket *getChannelBot(struct ChanNode *chan, int botid) { struct ChanUser *chanuser; for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { if(botid && bot->botid != botid) continue; - if((chanuser = getChanUser(bot->user, chan)) != NULL) { - if((chanuser->flags & CHANUSERFLAG_OPPED)) { + if(!chan || (chanuser = getChanUser(bot->user, chan)) != NULL) { + if(chan && (chanuser->flags & CHANUSERFLAG_OPPED)) { use_bot = bot; if(bot->flags & SOCKET_FLAG_PREFERRED) break; } else if(bot->flags & SOCKET_FLAG_PREFERRED)