Fixed not working hasShipyard key for stations.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1854 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
19cbb04377
commit
57b893d9f2
@ -1986,7 +1986,8 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl
|
||||
if ([shipinfoDictionary objectForKey:@"hasShipyard"])
|
||||
{
|
||||
PlayerEntity *player = [PlayerEntity sharedPlayer];
|
||||
id determinant = [shipinfoDictionary objectForKey:@"hasShipyard"];
|
||||
id determinant = [shipinfoDictionary objectForKey:@"hasShipyard"];
|
||||
|
||||
if ([determinant isKindOfClass:[NSArray class]])
|
||||
{
|
||||
NSArray *conditions = (NSArray *)determinant;
|
||||
@ -1996,9 +1997,9 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl
|
||||
success &= [player scriptTestCondition:(NSString *)[conditions objectAtIndex:i]];
|
||||
return success;
|
||||
}
|
||||
if ([determinant isKindOfClass:[NSNumber class]])
|
||||
else
|
||||
{
|
||||
float chance = [(NSNumber*)determinant floatValue];
|
||||
float chance = [shipinfoDictionary fuzzyBooleanForKey:@"hasShipyard"];
|
||||
return (randf() < chance);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user