Fixed unmarkSystem crash. Made ship AI send a beingAttacked message to scripts when a missile is fired against ship.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1321 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Nikos Barkas 2008-01-27 12:04:34 +00:00
parent 2175f6add3
commit 4d4ff0de25
2 changed files with 5 additions and 2 deletions

View File

@ -460,11 +460,14 @@ MA 02110-1301, USA.
return;
[self addTarget:missile];
// Notify own ship script that we are being attacked.
ShipEntity *hunter = [missile owner];
[self doScriptEvent:@"beingAttacked" withArgument:hunter];
if (has_ecm)
{
// use the ECM and battle on
ShipEntity *hunter = [missile owner];
[self setPrimaryAggressor:hunter]; // lets get them now for that!
found_target = primaryAggressor;

View File

@ -257,7 +257,7 @@ static JSBool MissionUnmarkSystem(JSContext *context, JSObject *obj, uintN argc,
PlayerEntity *player = OOPlayerForScripting();
NSString *params = nil;
player = [NSString concatenationOfStringsFromJavaScriptValues:argv count:argc separator:@" " inContext:context];
params = [NSString concatenationOfStringsFromJavaScriptValues:argv count:argc separator:@" " inContext:context];
[player removeMissionDestination:params];
return YES;