Fixed bug where station.shipyard generated shipyard when hasShipyard was false (#332)
This commit is contained in:
parent
5f8a8ff80b
commit
8cad99b852
@ -307,10 +307,18 @@ static JSBool StationGetProperty(JSContext *context, JSObject *this, jsid propID
|
||||
return YES;
|
||||
|
||||
case kStation_shipyard:
|
||||
{
|
||||
if (![entity hasShipyard])
|
||||
{
|
||||
// return null if station has no shipyard
|
||||
*value = OOJSValueFromNativeObject(context, nil);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([entity localShipyard] == nil) [entity generateShipyard];
|
||||
NSMutableArray *shipyard = [entity localShipyard];
|
||||
*value = OOJSValueFromNativeObject(context, shipyard);
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user