X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fbots.c;h=2c84a69f5567ee7581b14eeb778906fcb6ee69d4;hb=2278ae0efc3249c54509d969bdf863dc658dfa49;hp=4875b5a5c987e97036c6084b704c2ddb58a58362;hpb=70b7d70a96523b78cd470c6fe2ab78beb345d607;p=NeonServV5.git diff --git a/src/bots.c b/src/bots.c index 4875b5a..2c84a69 100644 --- a/src/bots.c +++ b/src/bots.c @@ -1,4 +1,4 @@ -/* bots.c - NeonServ v5.5 +/* bots.c - NeonServ v5.6 * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify @@ -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)