diff --git a/src/java/com/threerings/media/sprite/Sprite.java b/src/java/com/threerings/media/sprite/Sprite.java index 7cb542d90..1f2ed7866 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.53 2002/11/20 05:33:20 mdb Exp $ +// $Id: Sprite.java,v 1.54 2002/12/02 20:11:24 mdb Exp $ package com.threerings.media.sprite; @@ -285,7 +285,10 @@ public abstract class Sprite extends AbstractMedia _path.init(this, _pathStamp = tickStamp); } - return _path.tick(this, tickStamp); + // it's possible that as a result of init() the path completed and + // removed itself with a call to pathCompleted(), so we have to be + // careful here + return (_path == null) ? true : _path.tick(this, tickStamp); } // documentation inherited diff --git a/src/java/com/threerings/media/util/Path.java b/src/java/com/threerings/media/util/Path.java index c5447f550..9de85e777 100644 --- a/src/java/com/threerings/media/util/Path.java +++ b/src/java/com/threerings/media/util/Path.java @@ -1,5 +1,5 @@ // -// $Id: Path.java,v 1.8 2002/06/18 22:25:33 mdb Exp $ +// $Id: Path.java,v 1.9 2002/12/02 20:11:24 mdb Exp $ package com.threerings.media.util; @@ -21,7 +21,8 @@ public interface Path { /** * Called once to let the path prepare itself for the process of - * animating the supplied pathable. + * animating the supplied pathable. Path users should also call {@link + * #tick} after {@link #init} with the same initialization timestamp. */ public void init (Pathable pable, long tickStamp); diff --git a/src/java/com/threerings/media/util/TimedPath.java b/src/java/com/threerings/media/util/TimedPath.java index d5846e3e7..b1abf432d 100644 --- a/src/java/com/threerings/media/util/TimedPath.java +++ b/src/java/com/threerings/media/util/TimedPath.java @@ -1,5 +1,5 @@ // -// $Id: TimedPath.java,v 1.1 2002/09/17 03:59:05 mdb Exp $ +// $Id: TimedPath.java,v 1.2 2002/12/02 20:11:24 mdb Exp $ package com.threerings.media.util; @@ -34,8 +34,8 @@ public abstract class TimedPath implements Path // make a note of when we started _startStamp = timestamp; - // update our position to the start of the path - tick(pable, timestamp); + // we'll be ticked immediately following init() which will update + // our position to the start of our path } // documentation inherited