diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 9725d69b..b751a496 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -3000,6 +3000,7 @@ static PlayerEntity *sSharedPlayer = nil; [missile addTarget:target]; [missile setOrientation:q1]; [missile setStatus: STATUS_IN_FLIGHT]; // necessary to get it going! + [missile setIsMissileFlag:YES]; [missile setVelocity: vel]; [missile setSpeed:150.0]; [missile setOwner:self]; diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m index 819ca45a..e2607273 100644 --- a/src/Core/Entities/PlayerEntityControls.m +++ b/src/Core/Entities/PlayerEntityControls.m @@ -759,11 +759,8 @@ static NSTimeInterval time_last_frame; [self safeAllMissiles]; if (!ident_engaged) { - if (missile_status != MISSILE_STATUS_SAFE) - [UNIVERSE addMessage:DESC(@"missile-safe") forCount:2.0]; - //[UNIVERSE addMessage:[NSString stringWithFormat:@"%@ %@", DESC(@"missile-safe"), (primaryTarget != NO_TARGET && [self hasEquipmentItem:@"EQ_SCANNER_SHOW_MISSILE_TARGET"])? DESC(@"ident-off") : (NSString *)@""] forCount:2.5]; + [UNIVERSE addMessage:DESC(@"missile-safe") forCount:2.0]; [self playMissileSafe]; - } else { diff --git a/src/Core/Entities/ShipEntity.h b/src/Core/Entities/ShipEntity.h index aa191e14..cdb25b31 100644 --- a/src/Core/Entities/ShipEntity.h +++ b/src/Core/Entities/ShipEntity.h @@ -677,6 +677,8 @@ BOOL class_masslocks(int some_class); - (BOOL) fireLaserShotInDirection: (OOViewID) direction; - (BOOL) firePlasmaShot:(double) offset :(double) speed :(OOColor *) color; - (BOOL) fireMissile; +- (BOOL) isMissileFlag; +- (void) setIsMissileFlag:(BOOL)newValue; - (BOOL) fireECM; - (BOOL) activateCloakingDevice; - (void) deactivateCloakingDevice; diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 8b3ec091..e4e229bb 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -6528,7 +6528,7 @@ BOOL class_masslocks(int some_class) [missile setSpeed:150.0]; [missile setDistanceTravelled:0.0]; [missile setStatus:STATUS_IN_FLIGHT]; // necessary to get it going! - missile->isMissile = YES; + [missile setIsMissileFlag:YES]; [missile resetShotTime]; [UNIVERSE addEntity:missile]; @@ -6546,6 +6546,18 @@ BOOL class_masslocks(int some_class) } +- (BOOL) isMissileFlag +{ + return isMissile; // were we created using fireMissile? (for tracking submunitions) +} + + +- (void) setIsMissileFlag:(BOOL)newValue +{ + isMissile = !!newValue; // set the isMissile flag, used for tracking submunitions +} + + // Exposed to AI - (BOOL) fireECM { diff --git a/src/Core/Entities/ShipEntityScriptMethods.m b/src/Core/Entities/ShipEntityScriptMethods.m index d895f481..45efb9da 100644 --- a/src/Core/Entities/ShipEntityScriptMethods.m +++ b/src/Core/Entities/ShipEntityScriptMethods.m @@ -82,7 +82,7 @@ extern NSString * const kOOLogNoteAddShips; { [spawned setOwner:[self owner]]; [spawned addTarget:[self primaryTarget]]; - spawned->isMissile = YES; + [spawned setIsMissileFlag:YES]; } [result addObject:spawned]; }