diff --git a/Resources/Config/descriptions.plist b/Resources/Config/descriptions.plist index 3e9bf765..620d67f8 100644 --- a/Resources/Config/descriptions.plist +++ b/Resources/Config/descriptions.plist @@ -680,6 +680,13 @@ "Negative. %H security scans indicate your ship has a criminal record.", "Docking clearance is denied, as per GalCop Station Security Regulations." ); + "station-docking-clearance-denied" = + ( + "Docking clearance refused to all hostile vessels.", + "Docking not allowed. You are not welcome.", + "Negative. Your ship cannot dock here.", + "Docking clearance denied." + ); "station-docking-clearance-granted-until-@" = ( "You are cleared to dock. Please proceed. Clearance expires at %@", diff --git a/src/Core/Entities/PlayerEntityControls.m b/src/Core/Entities/PlayerEntityControls.m index 37fa57d0..bfb49478 100644 --- a/src/Core/Entities/PlayerEntityControls.m +++ b/src/Core/Entities/PlayerEntityControls.m @@ -384,18 +384,27 @@ static NSTimeInterval time_last_frame; } -- (void) targetNewSystem:(int) direction +- (void) targetNewSystem:(int) direction whileTyping:(BOOL) whileTyping { target_system_seed = [[UNIVERSE gui] targetNextFoundSystem:direction]; cursor_coordinates.x = target_system_seed.d; cursor_coordinates.y = target_system_seed.b; found_system_seed = target_system_seed; - [[UNIVERSE gameView] resetTypedString]; - if (planetSearchString) [planetSearchString release]; - planetSearchString = nil; + if (!whileTyping) + { + [[UNIVERSE gameView] resetTypedString]; + if (planetSearchString) [planetSearchString release]; + planetSearchString = nil; + } cursor_moving = YES; } + +- (void) targetNewSystem:(int) direction +{ + [self targetNewSystem:direction whileTyping:NO]; +} + @end @@ -1474,9 +1483,10 @@ static NSTimeInterval time_last_frame; { // always reset the found system index at the beginning of a new search if ([planetSearchString length] == 1) [[UNIVERSE gui] targetNextFoundSystem:0]; - found_system_seed = [UNIVERSE findSystemAtCoords:search_coords withGalaxySeed:galaxy_seed]; - moving = YES; - cursor_coordinates = search_coords; + + // Always select the right one out of 2 overlapping systems. + [self targetNewSystem:1 whileTyping:YES]; + [self targetNewSystem:-1 whileTyping:YES]; } else { diff --git a/src/Core/Entities/StationEntity.m b/src/Core/Entities/StationEntity.m index 64ade58d..d9ea04b0 100644 --- a/src/Core/Entities/StationEntity.m +++ b/src/Core/Entities/StationEntity.m @@ -2078,6 +2078,14 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE]; result = @"DOCKING_CLEARANCE_DENIED_SHIP_FUGITIVE"; } + + if (result == nil && [other hasHostileTarget]) // do not grant docking clearance to hostile ships. + { + [self sendExpandedMessage:DESC(@"station-docking-clearance-denied") toShip:other]; + if ([other isPlayer]) + [player setDockingClearanceStatus:DOCKING_CLEARANCE_STATUS_NONE]; + result = @"DOCKING_CLEARANCE_DENIED_SHIP_HOSTILE"; + } // Put ship in queue if we've got incoming or outgoing traffic if (result == nil && [shipsOnApproach count] && last_launch_time < timeNow)