diff --git a/src/as/com/threerings/crowd/client/LocationDirector.as b/src/as/com/threerings/crowd/client/LocationDirector.as index 09e08defe..42c8cceb7 100644 --- a/src/as/com/threerings/crowd/client/LocationDirector.as +++ b/src/as/com/threerings/crowd/client/LocationDirector.as @@ -313,18 +313,13 @@ public class LocationDirector extends BasicDirector _placeId = placeId; // check whether we should use a custom class loader - var cclass :Class = config.getControllerClass(); - try { - // start up a new place controller to manage the new place - _controller = (new cclass() as PlaceController); - _controller.init(_cctx, config); - - } catch (e :Error) { - Log.warning("Error creating or initializing place controller " + - "[cclass=" + cclass + - ", config=" + config + "]."); - Log.logStackTrace(e); + _controller = config.createController(); + if (_controller == null) { + Log.warning("Place config returned null controller " + + "[config=" + config + "]."); + return; } + _controller.init(_cctx, config); // subscribe to our new place object to complete the move _cctx.getDObjectManager().subscribeToObject(_placeId, this); diff --git a/src/as/com/threerings/crowd/data/PlaceConfig.as b/src/as/com/threerings/crowd/data/PlaceConfig.as index f0a1306fb..0a3b4cd86 100644 --- a/src/as/com/threerings/crowd/data/PlaceConfig.as +++ b/src/as/com/threerings/crowd/data/PlaceConfig.as @@ -48,7 +48,7 @@ public /*abstract*/ class PlaceConfig * this place. The controller class must derive from {@link * PlaceController}. */ - public function getControllerClass () :Class + public function createController () :PlaceController { return null; }