From e4a101cfc235f5b1e38281f3c3b4a9b0cecbb8ab Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Tue, 23 Oct 2001 01:59:50 +0000 Subject: [PATCH] On path completion, clear the path before observers are notified so that they can assign a new path to the sprite should they choose to do so. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@523 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/media/sprite/Sprite.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java index 424b6fbd1..a5076bfda 100644 --- a/src/java/com/threerings/media/sprite/Sprite.java +++ b/src/java/com/threerings/media/sprite/Sprite.java @@ -1,5 +1,5 @@ // -// $Id: Sprite.java,v 1.26 2001/10/22 18:13:09 shaper Exp $ +// $Id: Sprite.java,v 1.27 2001/10/23 01:59:50 shaper Exp $ package com.threerings.media.sprite; @@ -328,11 +328,13 @@ public class Sprite */ protected void pathCompleted () { - // inform observers that we've finished our path - notifyObservers(new PathCompletedEvent(this, _path)); - - // we no longer want to keep a reference to this path + // keep a reference to the path just completed + Path oldpath = _path; + // clear out the path we've now finished _path = null; + // inform observers that we've finished our path + notifyObservers(new PathCompletedEvent(this, oldpath)); + } /**