Changed station approach so only ships within scanner range are put on approach list. Docking procedure itself is unchanged and ships are given APPROACH instructions.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2565 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2009-09-21 20:41:35 +00:00
parent 3c1f0471e9
commit 207d178efb

View File

@ -407,6 +407,9 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl
delta.x -= position.x; delta.y -= position.y; delta.z -= position.z;
float ship_distance = sqrt(magnitude2(delta));
if (ship_distance > SCANNER_MAX_RANGE) // too far away - don't claim a docking slot by not putting on approachlist for now.
return instructions(universalID, position, 0, 10000, @"APPROACH", nil, NO);
[self addShipToShipsOnApproach: ship];
if (ship_distance < 1000.0 + collision_radius + ship->collision_radius) // too close - back off