Re: Question about a function to track stats.
[email protected] Wed, 28 Sep 2005 13:17:49 -0400
| Newsgroups | gmane.games.devel.mud.rom |
|---|---|
| Message-ID | <[email protected]> |
First off, this looks like a HUGE memory leak to me at "mob = create_mobile(
pMobIndex )", you are creating a new copy of every mob every 5 minutes
and then
not freeing it? If you can (presumably) just set the index data in the other
function (fight.c does it to the value 'killed' when you kill a mob),
why can't
you just read it back from the index instead of making a new mob and
then losing
it somewhere?
Brian.
> if ( ( pMobIndex = get_mob_index( vnum ) ) != NULL )
> {
> mob = create_mobile( pMobIndex );
> if (mob->pIndexData->kills >= 3 || mob->pIndexData->killed >= 3)
> {
> sprintf(buf,"%5d %5d %5d\n", mob->pIndexData->vnum,
> mob->pIndexData->kills, mob->pIndexData->killed);
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom