diff --git a/src/java/com/threerings/whirled/data/ScenePlace.java b/src/java/com/threerings/whirled/data/ScenePlace.java index f375b221..2846de9a 100644 --- a/src/java/com/threerings/whirled/data/ScenePlace.java +++ b/src/java/com/threerings/whirled/data/ScenePlace.java @@ -32,12 +32,20 @@ public class ScenePlace extends Place /** The id of the scene occupied by the body. */ public int sceneId; + /** + * Returns the scene id for the supplied place or -1 if the place is null or not a scene place. + */ + public static int getSceneId (Place place) + { + return (place instanceof ScenePlace) ? ((ScenePlace)place).sceneId : -1; + } + /** * Returns the scene id occupied by the supplied body or -1 if the body is not in a scene. */ public static int getSceneId (BodyObject bobj) { - return (bobj.location instanceof ScenePlace) ? ((ScenePlace)bobj.location).sceneId : -1; + return getSceneId(bobj.location); } /** Used when unserializing. */