From 69f0c50a3cc2f0e4b87615feb8a459cb0772ae42 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 1 Apr 2015 17:50:12 -0700 Subject: [PATCH] fix cleanup order to ensure environment is re-rendered --- examples/lobby.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/lobby.js b/examples/lobby.js index b13c78845a..3095740c93 100644 --- a/examples/lobby.js +++ b/examples/lobby.js @@ -232,6 +232,8 @@ function playRandomMuzak() { } function cleanupLobby() { + toggleEnvironmentRendering(true); + // for each of the 21 placeholder textures, set them back to default so the cached model doesn't have changed textures var panelTexturesReset = {}; panelTexturesReset["textures"] = {}; @@ -249,13 +251,18 @@ function cleanupLobby() { panelWall = false; orbShell = false; - currentDrone.stop(); - currentMuzakInjector.stop(); + if (currentDrone) { + currentDrone.stop(); + currentDrone = null + } - currentMuzakInjector = null; + if (currentMuzakInjector) { + currentMuzakInjector.stop(); + currentMuzakInjector = null; + } places = {}; - toggleEnvironmentRendering(true); + } function actionStartEvent(event) {