From 9de7ff77ba59d7ca326320aac19d6ef0853887b1 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 20 Aug 2002 18:21:45 +0000 Subject: [PATCH] Added isLocationOccupied() which allows server-side entities to determine definitively whether or not someone is in a location and/or has it reserved via a call to getUnoccupiedLocation(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1653 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../whirled/spot/server/SpotSceneManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java index b303ba9fc..56c926c25 100644 --- a/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java +++ b/src/java/com/threerings/whirled/spot/server/SpotSceneManager.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneManager.java,v 1.16 2002/08/14 19:07:58 mdb Exp $ +// $Id: SpotSceneManager.java,v 1.17 2002/08/20 18:21:45 mdb Exp $ package com.threerings.whirled.spot.server; @@ -69,11 +69,22 @@ public class SpotSceneManager extends SceneManager _sscene.getModel(), _locationOccs, preferClusters); if (locId != -1) { // mark the location as pending +// Log.info("Earmarked location [scene=" + where() + +// ", locId=" + locId + "]."); _locationOccs[_sscene.getLocationIndex(locId)] = -1; } return locId; } + /** + * Returns true if the location in question is occupied by another + * body (or reserved for someone who's on their way). + */ + public boolean isLocationOccupied (int locId) + { + return (_locationOccs[_sscene.getLocationIndex(locId)] != 0); + } + // documentation inherited protected void gotSceneData () {