- changed status to open
store previous BallData state for each ball
certain callbacks require knowledge of how the ball used to be to make an assessment on what to do. they could store this information themselves, but there is no harm in storing it in ArenaBallData.
Comments (4)
-
reporter -
reporter Hmm, due to the way the advisers run is implemented, both previous and balls will be set before advisers are called. Not a big deal.
-
reporter Wrapping up this self-rant: the details aren't really important, just keep in mind that accessing ArenaBallData from a balls adviser will probably yield unexpected results, not truly reflecting what the state of the ball was. If there are implementations that require their advisers knowing the exact state of the ball before any advisers were called, then the code can be reworked.
Also attempting to PlaceBall will likely fail (though this is okay since advisers shouldn't be triggering actions like this.)
Addressed, untested, Wiki macro error: Changeset 1044 not found.
-
reporter - changed status to resolved
Running without problems, with one minor application. Updated in Wiki macro error: Changeset 1064 not found. to make sure a stale pointer isn't left in this previous struct.
- Log in to comment
Proposed solution: Add
struct BallData *old;
to ArenaBallData, which is updated before balls[ballid] is, between when advisers are called and when callbacks are called.