- Lowered the distribution range for ships added with 'addShipsToRoute' to MAX_SCANNER_RANGE

- Groups added with this command are now added closer to each other.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4410 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2011-02-26 13:51:31 +00:00
parent 71e7128d73
commit 4869900942

View File

@ -2049,7 +2049,7 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
// shorten the route by scanner range & sun radius, otherwise ships could be created inside it.
direction = vector_normal(vector_subtract(point0, point1));
point0 = vector_subtract(point0, vector_multiply_scalar(direction, radius0 + SCANNER_MAX_RANGE));
point0 = vector_subtract(point0, vector_multiply_scalar(direction, radius0 + SCANNER_MAX_RANGE * 1.1f));
}
else if ([route isEqualTo:@"st"])
{
@ -2062,18 +2062,18 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
// shorten the route by scanner range & radius, otherwise ships could be created inside the route destination.
direction = vector_normal(vector_subtract(point1, point0));
point1 = vector_subtract(point1, vector_multiply_scalar(direction, radius + SCANNER_MAX_RANGE));
point1 = vector_subtract(point1, vector_multiply_scalar(direction, radius + SCANNER_MAX_RANGE * 1.1f));
pos = [self fractionalPositionFrom:point0 to:point1 withFraction:routeFraction];
if(isGroup)
{
return [self addShipsAt:pos withRole:role quantity:count withinRadius:SCANNER_MAX_RANGE asGroup:YES];
return [self addShipsAt:pos withRole:role quantity:count withinRadius:(SCANNER_MAX_RANGE / 10.0f) asGroup:YES];
}
else
{
while (count--)
{
ship = [self addShipAt:pos withRole:role withinRadius:SCANNER_MAX_RANGE];
ship = [self addShipAt:pos withRole:role withinRadius:0]; // no radius because pos is already randomised with SCANNER_MAX_RANGE.
if (ship != nil) [ships addObject:ship];
if (count > 0) pos = [self fractionalPositionFrom:point0 to:point1 withFraction:routeFraction];
}