Ok, I've put in the code from mudmagic, but I'm getting a warning from it. Here is the warning:
boards.c: In function 'chk_unread':
boards.c:2074: warning: comparison between pointer and integer
make[1]: *** [o/boards.o] Error 1
Make: *** [all] Error 2
Here is the code:
void chk_unread( CHAR_DATA *ch )
{
BOARD_DATA *board;
NOTE_DATA *newnote;
short unread = 0;
char buf[MAX_INPUT_LENGTH];
struct stat fst;
short count = 0;
sprintf( buf, "%s%c/%s", PLAYER_DIR, tolower(ch->name[0]), ch->name );
if ( stat( buf, &fst ) != -1 )
{
sprintf( buf, "You were last on: %s\r", ctime( &fst.st_mtime ) );
send_to_char( buf, ch );
}
else
{
send_to_char( "For some reason, you weren't found in the player database.\n\r", ch );
return;
}
for ( board = first_board; board; board = board->next )
{
if ( board->num_posts == 0
|| board->min_read_level > ch->level
|| board->type != BOARD_NOTE )
continue;
for ( newnote = board->first_note; newnote; newnote = newnote->next )
{
if ( newnote->time > ch->pcdata->last_read )<----offending warning 2074.
unread += 1;
}
if ( unread != 0 )
{
sprintf( buf, "You have %d new note%s.\n\r",
unread, unread == 1 ? "" : "s" );
send_to_char( buf, ch );
unread = 0;
count += 1;
}
}
if ( count == 0 )
send_to_char( "You have no new messages on ANY boards.\n\r", ch );
return;
}
In mud.h I've put at the end:
in the "struct note_data" |