if ( !str_prefix( arg, "suppression" ))
{
if(type == NOTE_ARTICLE)
{
argument = one_argument(argument, arg2);
if ( !is_number( argument ) || !is_number( arg2 ) )
{
send_to_char(
"Which article's suppression are you trying to affect?\n\r",
ch );
send_to_char(
"And what number of successes are you setting it to?\n\r", ch);
send_to_char(
"(Use 0 for unsuppressed)\n\r", ch);
return;
}
anum = atoi( arg2 );
vnum = 0;
for ( pnote = *list; pnote != NULL; pnote = pnote->next )
{
if ( is_note_to( ch, pnote ) && ( vnum++ == anum ) )
{
pnote->successes = atoi(argument);
send_to_char("Suppression level set.\n\r", ch);
return;
}
}
void save_notes(int type)
{
FILE *fp;
char *name;
NOTE_DATA *pnote;
switch (type)
{
default:
return;
case NOTE_NOTE:
name = NOTE_FILE;
pnote = note_list;
break;
case NOTE_BACKGROUND:
name = BG_FILE;
pnote = bg_list;
break;
case NOTE_KNOWLEDGE:
name = KNOW_FILE;
pnote = know_list;
break;
case NOTE_ARTICLE:
name = NEWS_FILE;
pnote = news_list;
break;
}
fclose( fpReserve );
if ( ( fp = fopen( name, "w" ) ) == NULL )
{
perror( name );
}
else
{
for ( ; pnote != NULL; pnote = pnote->next )
{
if(type == NOTE_NOTE) {
fprintf( fp, "Sender %s~\n", pnote->sender);
fprintf( fp, "Date %s~\n", pnote->date);
fprintf( fp, "Stamp %ld\n", pnote->date_stamp);
fprintf( fp, "To %s~\n", pnote->to_list);
fprintf( fp, "Subject %s~\n", pnote->subject);
}
else if(type == NOTE_BACKGROUND || type == NOTE_KNOWLEDGE)
{
fprintf( fp, "Author %s~\n", pnote->sender);
fprintf( fp, "Date %s~\n", pnote->date);
fprintf( fp, "Stamp %ld\n", pnote->date_stamp);
fprintf( fp, "Keyword %s~\n", pnote->to_list);
fprintf( fp, "Diff %s~\n", pnote->subject);
}
else
{
fprintf( fp, "Author %s~\n", pnote->sender);
fprintf( fp, "Date %s~\n", pnote->date);
fprintf( fp, "Stamp %ld\n", pnote->date_stamp);
fprintf( fp, "Categ %s~\n", pnote->to_list);
fprintf( fp, "Subject %s~\n", pnote->subject);
}
fprintf( fp, "Success %d~\n", pnote->successes);
fprintf( fp, "Text\n%s~\n", pnote->text);
}
fclose( fp );
fpReserve = fopen( NULL_FILE, "r" );
return;
}
}
CC = gcc
PROF = -O -Wuninitialized
NOCRYPT =
C_FLAGS = -Wall -g $(PROF) $(NOCRYPT)
L_FLAGS = $(PROF)
O_FILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o comm.o const.o db.o fight.o subcmds.o\
handler.o interp.o lookup.o magic.o fight_old.o\
recycle.o save.o tables.o update.o olc.o\
olc_act.o olc_save.o string.o quest.o magic3.o\
mob_cmds.o mob_prog.o olc_mpcode.o social-edit.o
O_TESTFILES = act_comm.o act_enter.o act_info.o act_move.o act_obj.o act_wiz.o \
alias.o comm.o const.o db.o fight.o subcmds.o\
handler.o interp.o lookup.o magic.o fight_old.o\
recycle.o save.o tables.o update.o olc.o\
olc_act.o olc_save.o string.o quest.o magic3.o\
mob_cmds.o mob_prog.o olc_mpcode.o social-edit.o
pt: $(O_FILES)
rm -f project
rm -f project.exe
$(CC) $(L_FLAGS) -lm -o project $(O_FILES)
test: $(O_TESTFILES)
rm -f projecttest
rm -f projecttest.exe
$(CC) $(L_FLAGS) -lm -o projecttest $(O_TESTFILES)
.c.o: twilight.h
$(CC) -c $(C_FLAGS) $<
clean:
rm *.o
wipe:
rm -f *.o project
rm -f project.exe
rm -f projecttest
rm -f projecttest.exe
if(type == NOTE_ARTICLE) {
sprintf( buf, "[%3d] %s: %s\n\r%s\n\rCategory: %s\n\rSuppression Level: %d\n\r",
vnum -1,
pnote->sender,
pnote->subject,
pnote->date,
pnote->to_list,
pnote->successes);
all: $(O_FILES)
$(CC) $(L_FLAGS) -lm -o project $(O_FILES)
In the code I inherited, there are newspaper's (which are a modification of the note code). Now, we have the ability to suppress newspaper articles, but I discovered after taking it over there it was not saving the suppression. For those who don't know what I mean, suppression is basically getting the article "buried" so it doesn't make the newspaper printing (like if you don't want people to know there are vampires and someone makes an articles about vampires). So, this is the code, but I can't seem to figure out why it's not saving the increase in difficulty.
Can anyone see something I'm missing? Thank you in advance.
Arholly