- Fixed my recently added bug with multiple page report screens

- change in canAcceptEscort(), so that any non-escort ship with police scan class can have escorts/wingman and not only those with police role.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3846 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2010-12-12 17:42:01 +00:00
parent 1242dfdd67
commit 08b25acda7
2 changed files with 20 additions and 10 deletions

View File

@ -2039,12 +2039,17 @@ static NSTimeInterval time_last_frame;
{
BOOL reportEnded = ([dockingReport length] == 0);
[self playDismissedReportScreen];
[self setGuiToStatusScreen];
if(reportEnded)
{
[self setGuiToStatusScreen];
[self doScriptEvent:@"reportScreenEnded"]; // last report given. Screen is now free for missionscreens.
[self doWorldEventUntilMissionScreen:@"missionScreenOpportunity"];
}
else
{
[self setGuiToDockingReportScreen];
}
}
spacePressed = YES;
}

View File

@ -1245,7 +1245,14 @@ static GLfloat calcFuelChargeRate (GLfloat my_mass, GLfloat base_mass)
}
[escortGroup setLeader:self];
pilotRole = bounty ? @"pirate" : @"hunter"; // hunters have insurancies, pirates not.
if ([self isPolice])
{
pilotRole = @"police"; // police are always insured.
}
else
{
pilotRole = bounty ? @"pirate" : @"hunter"; // hunters have insurancies, pirates not.
}
while (_pendingEscortCount > 0)
{
@ -9094,19 +9101,17 @@ BOOL class_masslocks(int some_class)
{
return NO;
}
BOOL isEscort = [self isEscort];
//police has to be checked first!
if (!isEscort && [self hasPrimaryRole:@"police"]) // interceptors always should have police as primaryRole.
if (scanClass != [potentialEscort scanClass]) // this makes sure that wingman can only select police.
{
return [potentialEscort hasPrimaryRole:@"wingman"];
return NO;
}
if ([self bounty] == 0 && [potentialEscort bounty] != 0) // clean mothers can only accept clean escorts
{
return NO;
}
if (!isEscort)
if (![self isEscort]) // self is NOT wingman or escort
{
return [potentialEscort hasPrimaryRole:@"escort"];
return [potentialEscort isEscort]; // is wingman or escort
}
return NO;
}