Ok so I'm attempting to add this to 1.9 just had a decent to talk with David over at the mush forums about consts and the conversions so I think I'm doing ok now, I've gotten it pretty much compiling clean so far expect this one error.
So here is the function itself. However I am not sure how you'd correct this to make it work correctly?
Code:
void do_note_remove( CHAR_DATA * ch, const char *argument )
{
BOARD_DATA *board;
NOTE_DATA *pnote;
char arg[MIL];
short n_num = 0, r_num = 0, i = 0;
char s1[16], s2[16], s3[16];
snprintf( s1, 16, "%s", color_str( AT_BOARD, ch ) );
snprintf( s2, 16, "%s", color_str( AT_BOARD2, ch ) );
snprintf( s3, 16, "%s", color_str( AT_BOARD3, ch ) );
if( !( board = find_board( ch ) ) )
{
if( !argument || argument[0] == '\0' )
{
ch_printf( ch, "%sRemoves a note from the board.\r\n%sSyntax: %serase %s<%sboard%s> <%snote#%s>.[%sreply#%s]&D\r\n",
s1, s3, s1, s3, s2, s3, s2, s3, s2, s3 );
return;
}
argument = one_argument( argument, arg );
if( !( board = get_board( ch, arg ) ) )
{
ch_printf( ch, "%sNo board found!&D\r\n", s1 );
return;
}
}
else
ch_printf( ch, "%sUsing current board in room: %s%s&D\r\n", s1, s2, board->name );
if( !IS_BOARD_FLAG( board, BOARD_PRIVATE ) && !can_remove( ch, board ) )
{
send_to_char( "You are unable to remove the notes on this board.\r\n", ch );
return;
}
if( !argument || argument[0] == '\0' )
{
send_to_char( "Remove which note?\r\n", ch );
return;
}
while( 1 )
{
if( argument[i] == '.' )
{
r_num = atoi( argument + i + 1 );
argument[i] = '\0'; <-- this being line 2203.
n_num = atoi( argument );
break;
}
if( argument[i] == '\0' )
{
n_num = atoi( argument );
r_num = -1;
break;
}
i++;
}
n_num = atoi( argument );
if( n_num == 0 )
{
send_to_char( "Remove which note?\r\n", ch );
return;
}
if( r_num == 0 )
{
send_to_char( "Remove which reply?\r\n", ch );
return;
}
i = 1;
for( pnote = board->first_note; pnote; pnote = pnote->next )
{
if( IS_BOARD_FLAG( board, BOARD_PRIVATE ) && !is_note_to( ch, pnote ) && !can_remove( ch, board ) )
continue;
if( i == n_num )
break;
i++;
}
if( !pnote )
{
send_to_char( "Note not found!\r\n", ch );
return;
}
if( is_name( "all", pnote->to_list ) && !can_remove( ch, board ) )
{
send_to_char( "You can not remove that note.\r\n", ch );
return;
}
if( r_num > 0 )
{
NOTE_DATA *reply;
i = 1;
for( reply = pnote->first_reply; reply; reply = reply->next )
if( i == r_num )
break;
else
i++;
if( !reply )
{
send_to_char( "Reply not found!\r\n", ch );
return;
}
ch_printf( ch, "%sYou remove the reply from %s%s%s, titled '%s%s%s' from the %s%s%s board.&D\r\n",
s1, s2, reply->sender ? reply->sender : "--Error--", s1,
s2, reply->subject ? reply->subject : "--Error--", s1, s2, board->name, s1 );
note_remove( board, reply );
act( AT_GREY, "$n removes a reply from the board.", ch, NULL, NULL, TO_ROOM );
return;
}
ch_printf( ch, "%sYou remove the note from %s%s%s, titled '%s%s%s' from the %s%s%s board.&D\r\n",
s1, s2, pnote->sender ? pnote->sender : "--Error--", s1,
s2, pnote->subject ? pnote->subject : "--Error--", s1, s2, board->name, s1 );
note_remove( board, pnote );
act( AT_GREY, "$n removes a note from the board.", ch, NULL, NULL, TO_ROOM );
return;
}