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:
Nikos Barkas 2008-11-14 23:19:51 +00:00
parent 19cbb04377
commit 57b893d9f2

View File

@ -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);
}
}