My mistake...the code is actually this:

void mobstat_update (void)
{
     FILE *fp;
     int vnum;
     MOB_INDEX_DATA *pMobIndex;
     CHAR_DATA *mob;
     int nMatch;
     char buf[MSL];

    fclose(fpReserve);

    fp = fopen("../data/mobstat.txt","w");

    nMatch = 0;
    for (vnum = 0; nMatch < top_mob_index; vnum++)
    if ((pMobIndex = get_mob_index(vnum)) != NULL)
    {
      nMatch++;
      if ( ( pMobIndex = get_mob_index( vnum ) ) != NULL )
      {
       mob = create_mobile( pMobIndex );
       sprintf(buf,"%5d %5d %5d\n\r", mob->pIndexData->vnum,
mob->pIndexData->kills, mob->pIndexData->killed);
       fprintf( fp, buf );
      }

     fclose(fp);
     fpReserve = fopen( NULL_FILE, "r" );
     return;
    }
}

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mervine,
Keith
Sent: Wednesday, August 04, 2004 9:34 AM
To: [email protected]
Subject: Output to file


I am having a problem with something.  
I want to output to file a list of all mob vnums 
Their kill totals and the total times they have been killed.

When I let the update run, I get the following in the file....

    2     0     0
^M


Here is the code.  Can someone let me know what I'm doing wrong?
It should print out all existing mob vnums but it won't.  Unless
I am looking at it wrong(which I probably am)



Ive also tried hardcoding a number for top_mob_index (32768) but to no
avail.
Cheers,
-K

-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to