From fe323675e8fccde3fa858c74762678c9ac2db3c4 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 10 Dec 2008 01:07:12 +0000 Subject: [PATCH] Assign our starting location in the new addOccupantInfo() and do it before the occupant's oid is added so that our info is already in place when bodyEntered gets called. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@792 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../whirled/spot/server/SpotSceneManager.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index 7c8f3da8..7cc50c74 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -34,6 +34,7 @@ import com.threerings.presents.server.InvocationException; import com.threerings.crowd.chat.data.UserMessage; import com.threerings.crowd.chat.server.SpeakUtil; import com.threerings.crowd.data.BodyObject; +import com.threerings.crowd.data.OccupantInfo; import com.threerings.crowd.server.PlaceRegistry; import com.threerings.whirled.server.SceneManager; @@ -110,15 +111,6 @@ public class SpotSceneManager extends SceneManager updateLocation(body, portal.getLocation()); } - @Override - public void bodyWillEnter (BodyObject body) - { - super.bodyWillEnter(body); - - // assign this body a starting location in the scene - assignStartingLocation(body); - } - @Override protected void didStartup () { @@ -168,6 +160,16 @@ public class SpotSceneManager extends SceneManager } } + @Override + protected void addOccupantInfo (BodyObject body, OccupantInfo info) + { + // assign this body a starting location in the scene + assignStartingLocation(body); + + // then call super, so we know that our info will be ready before bodyAdded is triggered + super.addOccupantInfo(body, info); + } + /** * Give our new body a starting location. */