From 694f983ef3ce229e2b76a19ab9eccc93c965d0a4 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Mon, 6 Dec 2010 04:46:12 +0000 Subject: [PATCH] One day perhaps we'll consider a world where clients can flit between bodies willy nilly and bodies don't necessarily have a client attached to them, but until that day, we're going to require that BodyObject.getClientObject() returns non-null when the body is in the wild. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6342 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/main/java/com/threerings/crowd/data/BodyObject.java | 2 ++ .../java/com/threerings/crowd/server/LocationManager.java | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/threerings/crowd/data/BodyObject.java b/src/main/java/com/threerings/crowd/data/BodyObject.java index a45275ed0..3a0c17568 100644 --- a/src/main/java/com/threerings/crowd/data/BodyObject.java +++ b/src/main/java/com/threerings/crowd/data/BodyObject.java @@ -134,6 +134,8 @@ public class BodyObject extends ClientObject * Return the {@link ClientObject} that represent our driving user's connection. This is * the reverse operation of {@link BodyLocator#forClient} and should match it. The default * implementation assumes the client object and the body object are one and the same. + * + * Do not return null here once this object is in the wild. */ public ClientObject getClientObject () { diff --git a/src/main/java/com/threerings/crowd/server/LocationManager.java b/src/main/java/com/threerings/crowd/server/LocationManager.java index 67fdc8dc5..115556606 100644 --- a/src/main/java/com/threerings/crowd/server/LocationManager.java +++ b/src/main/java/com/threerings/crowd/server/LocationManager.java @@ -178,10 +178,7 @@ public class LocationManager leaveOccupiedPlace(source); // then send a forced move notification to the body's client - ClientObject clobj = source.getClientObject(); - if (clobj != null) { - LocationSender.forcedMove(clobj, place.placeOid); - } + LocationSender.forcedMove(source.getClientObject(), place.placeOid); } @Inject protected RootDObjectManager _omgr;