From dae85931313beb1cdee2ab1b6bb955fc2756cc6b Mon Sep 17 00:00:00 2001 From: cim Date: Thu, 19 Dec 2013 18:53:52 +0000 Subject: [PATCH] Adjust cleanup after launching from station in lesson 7 --- Resources/Scripts/oolite-tutorial.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Resources/Scripts/oolite-tutorial.js b/Resources/Scripts/oolite-tutorial.js index 4956543d..ab712b5f 100644 --- a/Resources/Scripts/oolite-tutorial.js +++ b/Resources/Scripts/oolite-tutorial.js @@ -152,6 +152,7 @@ this.startUp = function() { this._setFrameCallback(""); player.ship.setMultiFunctionText("oolite-tutorial",null); + this._resetShips(station); } @@ -419,13 +420,18 @@ this.startUp = function() } - this._resetShips = function() + // exception parameter used to avoid removing the station the + // player is docked with + this._resetShips = function(exception) { for (var i=this.$shipList.length-1;i>=0;i--) { if (this.$shipList[i] && this.$shipList[i].isShip) { - this.$shipList[i].remove(true); + if (!exception || exception != this.$shipList[i]) + { + this.$shipList[i].remove(true); + } } } }