#!/bin/sh
# Makefile for Solaris 2.1 on a Sparc 10 with gcc.
# Changes contributed by Torsten Spindler.
# To use standard MERC mobprogs, comment out the -DMPROG_NEW
DATE=`date +%m%d%Y`
CC = gcc
PROF = -ggdb -lm
C_FLAGS = -Wall $(PROF) -Dlinux
L_FLAGS = -lcrypt -lpthread
# SYSTEM = #-DMPROG_NEW
O_FILES = threadedcommand.o livemaze.o mapmakerv2.o act_comm.o act_info.o act_move.o\
act_obj.o act_wiz.o alias.o fileutils.o anmagic.o anmagic2.o anmagic3.o\
anskills.o bit.o clans.o comm.o const.o color.o craft.o db.o db2.o effects.o\
fight.o flags.o handler.o interp.o note.o magic.o magic2.o mob_comm.o\
mob_prog.o misc.o olc.o olcmem.o olcsave.o recycle.o protocol.o\
save.o skills.o special.o string.o tables.o track.o update.o \
www.o anobjcraft.o event.o
all: $(O_FILES)
$(CC) -o anrun $(O_FILES) $(L_FLAGS)
gcc –version
mv *.o ../ANBuildResult
mv anrun ../ANBuildResult
.c.o: an.h
$(CC) -c $(C_FLAGS) $<
clean:
rm -f *.o
rm -f anrun
rm -f ../ANBuildResult/*.o
rm -f ../ANBuildResult/anrun
for ( ; pnote != NULL; pnote = pnote->next )
for ( pnote = news_list; pnote != NULL; pnote = pnote->next )
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);
}
+++ syslog("pnote-> subject = %s, pnote-> successess =%d", pnote->subject, pnote->successes); +++
fprintf( fp, "Success %d~\n", pnote->successes);
fprintf( fp, "Text\n%s~\n", pnote->text);
}
void do_test( CHAR_DATA *ch, char *argument )
{
save_notes(NOTE_ARTICLE);
}
fprintf( fp, "Date %s~\n", pnote->date); <——- Needs '~'
fprintf( fp, "Stamp %ld\n", pnote->date_stamp); <——- Doesn't.
int media_suppress(CHAR_DATA *ch, char *argument)
{
int fail = dice_rolls(ch, ch->influences[INFL_MEDIA], 8);
char buf[MAX_STRING_LENGTH];
int anum, vnum;
NOTE_DATA *pnote;
if(argument[0] == '\0' || !is_number(argument))
{
send_to_char("Which article are you trying to suppress?\n\r", ch);
return FALSE;
}
if(fail > 0)
{
anum = atoi( argument );
vnum = 0;
for ( pnote = news_list; pnote != NULL; pnote = pnote->next )
{
if ( is_note_to( ch, pnote ) && vnum++ == anum )
{
sprintf(buf, "You arrange the suppression of '%s'.\n\r",
pnote->subject);
send_to_char(buf, ch);
pnote->successes += fail;
ch->influences[INFL_MEDIA]–;
return TRUE;
}
}
sprintf(buf,"There aren't that many articles.\n\r");
send_to_char(buf,ch);
return FALSE;
}
else if(fail == 0)
{
send_to_char("Your wiles fail to suppress the article.\n\r", ch);
ch->influences[INFL_MEDIA]–;
}
else
{
send_to_char("You offend some members of the media.\n\r", ch);
ch->influences[INFL_MEDIA] -= UMIN(2, ch->influences[INFL_MEDIA]);
}
ch->infl_timer = 5;
/* Added this so it will force the saving of the suppression */
save_notes(NOTE_ARTICLE);
return TRUE;
}
if(fail > 0)
{
anum = atoi( argument );
vnum = 0;
for ( pnote = news_list; pnote != NULL; pnote = pnote->next )
{
if ( is_note_to( ch, pnote ) && vnum++ == anum )
{
sprintf(buf, "You arrange the suppression of '%s'.\n\r",
pnote->subject);
send_to_char(buf, ch);
pnote->successes += fail;
ch->influences[INFL_MEDIA]–;
return TRUE;
}
}
sprintf(buf,"There aren't that many articles.\n\r");
send_to_char(buf,ch);
return FALSE;
}
if(fail > 0)
{
anum = atoi( argument );
vnum = 0;
for ( pnote = news_list; pnote != NULL; pnote = pnote->next )
{
if ( is_note_to( ch, pnote ) && vnum++ == anum )
{
sprintf(buf, "You arrange the suppression of '%s'.\n\r",
pnote->subject);
send_to_char(buf, ch);
pnote->successes += fail;
ch->influences[INFL_MEDIA]–;
/* Added this so it will force the saving of the suppression */
save_notes(NOTE_ARTICLE);
return TRUE;
}
}
sprintf(buf,"There aren't that many articles.\n\r");
send_to_char(buf,ch);
return FALSE;
}
int x;
x += 1;
NOTE_DATA *pnote = note_list;
Next thing I would do is to make sure the function loading the articles points to the same file (the one defined by NOTE_FILE).