* Fix bug with Docking Clearance - could no longer cancel requests

* Fix bug with Docking Clearance - waive fine when in Escape Pod



git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1851 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Michael Werle 2008-11-13 02:25:11 +00:00
parent 8d22e3c41c
commit 520c61fbb3
2 changed files with 22 additions and 14 deletions

View File

@ -3207,6 +3207,9 @@ static PlayerEntity *sSharedPlayer = nil;
status = STATUS_ESCAPE_SEQUENCE; // firstly
ship_clock_adjust += 43200 + 5400 * (ranrot_rand() & 127); // add up to 8 days until rescue!
#ifdef DOCKING_CLEARANCE_ENABLED
dockingClearanceStatus = DOCKING_CLEARANCE_STATUS_NOT_REQUIRED;
#endif
q1.w = -q1.w; // player view is reversed remember!

View File

@ -1876,22 +1876,27 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl
// time-out or cancellation (but only for the Player).
if( result == nil && [other isPlayer] && self == [player getTargetDockStation])
{
if ([player getDockingClearanceStatus] == DOCKING_CLEARANCE_STATUS_TIMING_OUT)
switch( [player getDockingClearanceStatus] )
{
last_launch_time = timeNow + DOCKING_CLEARANCE_WINDOW;
[self sendExpandedMessage:[NSString stringWithFormat:
DESC(@"your-docking-clearance-has-been-extended-until-@"),
ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
case DOCKING_CLEARANCE_STATUS_TIMING_OUT:
last_launch_time = timeNow + DOCKING_CLEARANCE_WINDOW;
[self sendExpandedMessage:[NSString stringWithFormat:
DESC(@"your-docking-clearance-has-been-extended-until-@"),
ClockToString([player clockTime] + DOCKING_CLEARANCE_WINDOW, NO)]
toShip:other];
[player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_GRANTED];
result = @"DOCKING_CLEARANCE_EXTENDED";
}
else if ([player getDockingClearanceStatus] > DOCKING_CLEARANCE_STATUS_REQUESTED)
{
last_launch_time = timeNow;
[self sendExpandedMessage:DESC(@"docking-clearance-cancelled") toShip:other];
[player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
result = @"DOCKING_CLEARANCE_CANCELLED";
[player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_GRANTED];
result = @"DOCKING_CLEARANCE_EXTENDED";
break;
case DOCKING_CLEARANCE_STATUS_REQUESTED:
case DOCKING_CLEARANCE_STATUS_GRANTED:
last_launch_time = timeNow;
[self sendExpandedMessage:DESC(@"docking-clearance-cancelled") toShip:other];
[player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE];
result = @"DOCKING_CLEARANCE_CANCELLED";
break;
case DOCKING_CLEARANCE_STATUS_NONE:
case DOCKING_CLEARANCE_STATUS_NOT_REQUIRED:
break;
}
}