diff --git a/botthread.c b/botthread.c index 6233836..d056cb5 100644 --- a/botthread.c +++ b/botthread.c @@ -328,8 +328,7 @@ return(0x0); } // tuveBotSetSong() -int nextSong() { - short lC = 0x0; +int nextSong() { char output[1024]; tuveChanList_t *tmpChans; tuveUserList_t *tmpUser; @@ -344,9 +343,9 @@ for (tmpChans = channels;tmpChans != 0x0;tmpChans = tmpChans->next) { if ((tmpChans->modes[CHAN_LIVE] == 0x0) && (tmpChans->videoEnd < curTime)) { /* Set point to starting user */ + tmpUser = tmpChans->nextUser; findUser: - lC++; if (tmpChans->modes[CHAN_QUEUE] == 0x0) /* If Channel Has Queues Disabled Jump Right To Random */ goto getRandom; if (tmpChans->nextUser != 0x0) { @@ -367,11 +366,12 @@ tmpChans->count++; } else { - tmpChans->count = MAX_COUNT; - if ((tmpUser != tmpChans->nextUser) && (lC < 3)) { + if ((tmpUser != tmpChans->nextUser) || (tmpChans->count != MAX_COUNT)) { writeLog(0,"MAXCNT"); + tmpChans->count = MAX_COUNT; goto findUser; } + tmpChans->count = MAX_COUNT; /* Find A Random Song */ getRandom: diff --git a/nick.c b/nick.c index 560d3da..bae2ac0 100644 --- a/nick.c +++ b/nick.c @@ -59,7 +59,7 @@ sprintf(output,"MSG:TUveD:STATUS:%s is %s",user->userInfo.username,user->host); sSendData(userConnection,output); - output[sprintf(output,"MSG:TUveD:STATUS:%s Signed On %s",user->userInfo.username,ctime(&user->signedOn))-1] = '\0'; + sprintf(output,"MSG:TUveD:STATUS:%s Signed On %s",user->userInfo.username,ctime(&user->signedOn)); sSendData(userConnection,output); if (user->userInfo.modes[USER_OVERLORD] == 1) {