diff --git a/Resources/AIs/hardMissileAI.plist b/Resources/AIs/hardMissileAI.plist index f057bcf2..b01f7f96 100644 --- a/Resources/AIs/hardMissileAI.plist +++ b/Resources/AIs/hardMissileAI.plist @@ -42,7 +42,7 @@ }; DETONATE = { - ENTER = ("sendScriptMessage: detonate"); + ENTER = ("sendScriptMessage: ooliteDetonateAsStandardMissile"); }; EXPLODE = { diff --git a/Resources/AIs/missileAI.plist b/Resources/AIs/missileAI.plist index 5868fb60..98783990 100644 --- a/Resources/AIs/missileAI.plist +++ b/Resources/AIs/missileAI.plist @@ -38,7 +38,7 @@ }; DETONATE = { - ENTER = ("sendScriptMessage: detonate"); + ENTER = ("sendScriptMessage: ooliteDetonateAsStandardMissile"); }; EXPLODE = { diff --git a/Resources/Scripts/oolite-default-ship-script.js b/Resources/Scripts/oolite-default-ship-script.js index e4a31658..576d5899 100644 --- a/Resources/Scripts/oolite-default-ship-script.js +++ b/Resources/Scripts/oolite-default-ship-script.js @@ -109,3 +109,11 @@ if (this.legacy_setupActions !== undefined) */ this.ship.__runLegacyScriptActions(this.ship, this.legacy_setupActions); } + + +// function for missiles and other entities using missile AI +this.ooliteDetonateAsStandardMissile = function() +{ + this.ship.dealEnergyDamage(170, 32.5, 0.25); + this.ship.explode(); +} diff --git a/Resources/Scripts/oolite-missile.js b/Resources/Scripts/oolite-missile.js deleted file mode 100644 index 5d193edd..00000000 --- a/Resources/Scripts/oolite-missile.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - -oolite-missile.js - -Ship script for Missiles and Hardheads. - - -Oolite -Copyright © 2004-2013 Giles C Williams and contributors - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -MA 02110-1301, USA. - -*/ - - -/*jslint white: true, undef: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */ -/*global missionVariables, player*/ - - -"use strict"; - - -this.name = "oolite-missile"; -this.author = "cim"; -this.copyright = "© 2008-2013 the Oolite team."; -this.version = "1.77"; - -this.detonate = function() -{ - this.ship.dealEnergyDamage(170, 32.5, 0.25); - this.ship.explode(); -} diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 84688be6..0844373f 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -10609,13 +10609,6 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q // end special cases - // set the default missile script if none is assigned - // harmless if it's an OXP missile that doesn't need it - if ([[[missile shipScript] name] isEqualToString:@"oolite-default-ship-script"]) - { - [missile setShipScript:@"oolite-missile.js"]; - } - [missile setPosition:origin]; [missile addTarget:target]; [missile setOrientation:q1]; diff --git a/src/Core/OOCacheManager.m b/src/Core/OOCacheManager.m index a2fa13bb..f5301ab4 100644 --- a/src/Core/OOCacheManager.m +++ b/src/Core/OOCacheManager.m @@ -74,7 +74,7 @@ static NSString * const kCacheKeyCaches = @"caches"; enum { kEndianTagValue = 0x0123456789ABCDEFULL, - kFormatVersionValue = 209 + kFormatVersionValue = 210 };