[CODE] Addition to mobact.c help please.

From: RHS Linux User (carnage@games2.mudsrus.com)
Date: 12/24/98


Ok I ported this out of PhoenixMud because I thought it was a pretty kewl
idea.  After converting somethings to the 3.0 pointers I went to compile
it and it appears to compile well except for this error:
mobact.c: In function `mobile_activity':
mobact.c:46: warning: `vict' might be used uninitialized in this function

When I boot the mud than add attach the flag to it the mob just keeps
recalling itself and not hunting down the player killer like its sappose
to do!  Anyone know how to fix this?  I figured its probley something
stupid but I just don't see it.  Thanx.

         if (MOB_FLAGGED(ch, MOB_HUNT_KILLER)){
           for (found = 0, tmp = character_list; tmp && !found; tmp =
tmp->next)
             if ((!IS_NPC(tmp) && PLR_FLAGGED(tmp, PLR_KILLER)) ||
(!IS_NPC(tmp) && PLR_FLAGGED(tmp, PLR_THIEF))){
               found = 1;
               vict = tmp;
              }

           if (found == 1){
             dir = find_first_step(ch->in_room, vict->in_room);
             if (dir < 0) {
               ranum = number(0,100);
               if (ranum > 80){
                 sprintf(buf, "Where the hell did %s go!!!",
GET_NAME(vict));
                 do_say(ch, buf, 0, 0);}
               temple=real_room(3001);
               if (ch->in_room != temple)
/*               do_recall(ch,NULL,0,0); */
                 cast_spell(ch, NULL, NULL, SPELL_WORD_OF_RECALL);
               return;
             } else {
               do_move(ch, "", dir+1, 0);
               temple = real_room(3001);
               if (ch->in_room != temple)
                 if (vict->in_room == temple)
/*                 do_recall(ch,NULL,0,0); */
                   cast_spell(ch, NULL, NULL, SPELL_WORD_OF_RECALL);
               ranum = number(0,500);
               if ((ranum > 90) && (ranum < 100)){
                 sprintf(buf, "You WILL DIE %s. How dare you Player
kill!!",
 GET_NAME(vict));
                 do_gen_comm(ch, buf, 0, SCMD_GOSSIP);}
               if ((ranum < 80) && (ranum >70)){
                 sprintf(buf, "%s, You are going to die a HORRIBLE
DEATH!!",
 GET_NAME(vict));
                 do_gen_comm(ch, buf, 0, SCMD_GOSSIP);}
               if ((ranum < 60) && (ranum >50)){
                 sprintf(buf, "%s, You have been CONDEMED!! by the gods to
 DIE!!", GET_NAME(vict));
                 do_gen_comm(ch, buf, 0, SCMD_SHOUT);}
               if ((ranum < 40) && (ranum > 30)){
                 sprintf(buf, "You can not escape me %s!",
GET_NAME(vict));
                 do_gen_comm(ch, buf, 0, SCMD_SHOUT);}
               if (ch->in_room == vict->in_room){
                 sprintf(buf, "Now you WILL DIE, %s!!", GET_NAME(vict));
                 do_say(ch, buf, 0, 0);
                 hit(ch, vict, 0);}
               return;
             }
           }
         }


Thanx again:>


-Smillie, IMP
MAximum Carnage
Carnage.mudsrus.com 6669


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST