diff --git a/Resources/Scripts/oolite-default-ship-script.js b/Resources/Scripts/oolite-default-ship-script.js index 765c81e9..b86e243f 100644 --- a/Resources/Scripts/oolite-default-ship-script.js +++ b/Resources/Scripts/oolite-default-ship-script.js @@ -29,7 +29,7 @@ MA 02110-1301, USA. /*jslint white: true, undef: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */ -// "use strict"; //FIXME: can't delete legacy_fooActions. +"use strict"; this.name = "oolite-default-ship-script"; @@ -50,9 +50,7 @@ if (this.legacy_launchActions !== undefined) */ this.ship.runLegacyScriptActions(this.ship, this.legacy_launchActions); - // These can only be used once; keeping them around after that is pointless. delete this.shipSpawned; - delete this.legacy_launchActions; }; } @@ -110,5 +108,4 @@ if (this.legacy_setupActions !== undefined) future. Do not use it in your own scripts. */ this.ship.runLegacyScriptActions(this.ship, this.legacy_setupActions); - delete this.legacy_setupActions; } diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 2eba184c..9d106b04 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -5238,7 +5238,7 @@ NSComparisonResult ComparePlanetsBySurfaceDistance(id i1, id i2, void* context) if (actions) [properties setObject:actions forKey:@"legacy_setupActions"]; script = [OOScript JSScriptFromFileNamed:@"oolite-default-ship-script.js" - properties:properties]; + properties:properties]; } [script retain]; } diff --git a/src/Core/Scripting/OOJavaScriptEngine.m b/src/Core/Scripting/OOJavaScriptEngine.m index ded0f817..5661f304 100644 --- a/src/Core/Scripting/OOJavaScriptEngine.m +++ b/src/Core/Scripting/OOJavaScriptEngine.m @@ -332,8 +332,8 @@ static void ReportJSError(JSContext *context, const char *message, JSErrorReport // Run prefix script. [OOJSScript JSScriptFromFileNamed:@"oolite-global-prefix.js" - properties:[NSDictionary dictionaryWithObject:JSSpecialFunctionsObjectWrapper(mainContext) - forKey:@"special"]]; + properties:[NSDictionary dictionaryWithObject:JSSpecialFunctionsObjectWrapper(mainContext) + forKey:@"special"]]; OOLog(@"script.javaScript.init.success", @"Set up JavaScript context.");