fix for pirate cove defense-ships not working

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2096 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
cmdrjames 2009-03-18 00:39:57 +00:00
parent bac97c78e0
commit 47213c7a5e
2 changed files with 11 additions and 6 deletions

View File

@ -68,14 +68,14 @@
};
"TRAVEL_TO_LURK_AREA" =
{
ENTER =
(setDestinationToCurrentLocation, "setDesiredRangeTo: 1500.0", performFlyToRangeFromDestination);
ENTER = (setDestinationToCurrentLocation, "setDesiredRangeTo: 3500.0", performFlyToRangeFromDestination);
ATTACKED = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LURK");
"GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
"ENTER WORMHOLE" = ("setStateTo: ENTER_WORMHOLE");
"EXITED WITCHSPACE" = ("switchAITo: enteringPirateAI.plist"); // Unreachable? If so, enteringPirateAI and enteringTraderAI are unused.
"FRUSTRATED" = ("setStateTo: LURK");
};
"CONSIDER_DOCKING" =
{

View File

@ -1649,13 +1649,18 @@ ShipEntity* doOctreesCollide(ShipEntity* prime, ShipEntity* other)
for (escortEnum = [self escortEnumerator]; (escort = [escortEnum nextObject]); )
{
if ([self scanClass] != [escort scanClass]) {
//you are only allowed to escort something with the same scanclass, so you are on your own now
[escort setGroup:NO_TARGET];
}
[escort setDestination:[self coordinatesForEscortPosition:i++]];
}
}
if ([self escortGroup] != nil)
{
ShipEntity *leader = [[self escortGroup] leader];
if (leader != nil && ([leader scanClass] != [self scanClass])) {
OOLog(@"ship.sanityCheck.failed", @"Ship %@ escorting %@ with wrong scanclass!", self, leader);
[[self escortGroup] removeShip:self];
[[self escortGroup] release];
}
}
}
// subentity rotation