index_data (fwd)

From: Jeff (
Date: 09/10/94

Eric Pilcher <rasta@CSOS.ORST.EDU> writes:
> jfink writes:
> > I've actually coded a solution to this, and I used option a because I
> > only have to do the search once, and I can keep accurate numbers after
> > that.  Basically, you need to go into objsave.c and when a new user comes
> > into the game, SUBTRACT one instance of the object as it is being created,
> > because the creation routine will add one back in.  When a player exits
> > the game, ADD one instance of the object, since the purge routine subtracts
> > one.  
> >	All the numbers will end up balancing fine, and will only change if
> > someone junks something, a zone resets, a God creates a new item, a shop
> > produces something, or create food gets cast (there's probably more).  The
> > best part is that this technique only modifies the code in 3 places, and
> > the rest work fine.
> Hmmm... any plans to modify these routines so that they also add or subtract
> an instance of the object?  Seems like you've already done most the hard
> work.  Why not set up the the ADD and SUBTRACT counters as modular routines
> and then just modify these other cases to call the appropriate routine?

I didn't phrase that very clearly, let me try again.  My code works, the
way it should, because the numbers only change when someone junks something,
etc.  The numbers change in those cases because something is either leaving
the game (permanently, and thus should not be counter) or entering the came
(permanently, and thus should be counted).  What I was trying to say was
that modifying the routines in objsave.c make it so that you don't have to
modify the code anywhere else.


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