[CODE][NEWBIE] Bragging NPC's compiler error

From: William Matthews (trutone@netzero.net)
Date: 06/14/01


Using Borland C++ under Win98, release 30bpl18

I have received the following errors from comm.c when attempting to compile:

Undefined symbol 'C_NRM' in function brag
Type mismatch in parameter 'messg' in call to 'send_to_char' in function brag

Code for comm.h is:

void    brag(struct char_data *ch, struct char_data *victim);

Code for fight.c is:

/* External procedures */
void brag(struct char_data * ch, struct char_data * victim);

_Now call the brag fuction whenever an npc kills a player character.  I
added it within the following conditional, and works like a charm.

if (!IS_NPC(victim)) {
      sprintf(buf2, "%s killed by %s at %s", GET_NAME(victim), GET_NAME(ch),
      world[victim->in_room].name);
      mudlog(buf2, BRF, LVL_IMMORT, TRUE);
    if (IS_NPC(ch))
      brag(ch, victim);    /* <- Insert brag call here */
      if (MOB_FLAGGED(ch, MOB_MEMORY))
        forget(ch, victim);


The code for comm.c file is:

void brag(struct char_data *ch, struct char_data *vict)
{

 /* Npc taunts slayed player characters.  Text goes out through gossip
    channel.  Muerte - telnet://betterbox.net:4000                     */

struct descriptor_data *i;
char brag[256]={"       "};

   switch (number(0, 11)) {
  case 0:
   sprintf(brag, "$n brags, '%s was just too easy a kill!'", GET_NAME(vict));
  break;
  .
  .
  . (case 1 - 11 just repeated format)
  }

   for (i = descriptor_list; i; i = i->next)
     if (!i->connected && i != ch->desc && i->character &&
        !PRF_FLAGGED(i->character, PRF_NOGOSS) &&
        !PLR_FLAGGED(i->character, PLR_WRITING) &&
        !ROOM_FLAGGED(i->character->in_room, ROOM_SOUNDPROOF))  {

     if (COLOR_LEV(i->character) >= C_NRM)
        send_to_char(CCRED(i->character, C_NRM), i->character);

        act(brag, FALSE, ch, 0, i->character, TO_VICT | TO_SLEEP);

     if (COLOR_LEV(i->character) >= C_NRM)
        send_to_char(CCNRM(i->character, C_NRM), i->character);
   }
}


I pulled the code from the ftp site, and checked the archives for any posts
but could not find one.

Searched the src directory for files containing C_NRM and came up with the
following:

act.informative.c
act.comm.c
act.wizard.c
screen.h
utils.c
comm.c (obviously)

The directions given do not indicate any modification neccessary to these
files
except comm.c

If anyone has come across this problem, any help would be appreciated.

Thanks.

Will M.



NetZero Platinum
No Banner Ads and Unlimited Access
Sign Up Today - Only $9.95 per month!
http://www.netzero.net

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST