CODE problem [part 3]

From: Homer Simpson (fcolvin@metz.une.edu.au)
Date: 10/03/96


Hiya all,
         After adding heaps of log commands to see where the mud crashes 
I have found the following. The sprintf line below outputs the following:

Time_Trigger Mob: 33(-1)

There is a mob number 33, and he is loaded into the mud. I know I'm doing 
something wrong but can't work out what. Any ideas?

Homer

aka Fionn Colvin :)


const int time_mobs[] =
{
    33,
    -1
};

void mprog_time_trigger(int time)
{
   struct char_data *mob;
   MPROG_DATA *mprg;
   int r_num = 0;
   int pos = 0;

   for (r_num = time_mobs[pos]; r_num != -1; r_num = time_mobs[++pos]) { 
     mob = read_mobile(r_num, REAL);
     if (IS_NPC(mob) && (mob_index[mob->nr].progtypes & TIME_PROG))
       for (mprg = mob_index[mob->nr].mobprogs; mprg != NULL; mprg = mprg->next)
         if (mprg->type & TIME_PROG)
           if (time == atoi(mprg->arglist)) {
             sprintf(buf, "Time_Trigger Mob: %d(%d)", mob->nr, mob->in_room);
             log(buf);
             mprog_driver(mprg->comlist, mob, NULL, NULL, NULL);
             break;
           }
   } 
   return; 
}
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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