Fix bad return of credits quantity

This commit is contained in:
Jens Ayton 2017-06-06 12:25:05 +02:00
parent 55212d4d02
commit 11504bb64f

View File

@ -618,13 +618,13 @@ static JSBool SystemInfoSamplePrice(JSContext *context, uintN argc, jsval *vp)
BOOL sameGalaxy = ([thisInfo galaxy] == [PLAYER galaxyNumber]);
if (!sameGalaxy)
{
OOJSReportErrorForCaller(context, @"SystemInfo", @"routeToSystem", @"Cannot calculate sample price for destinations in other galaxies.");
OOJSReportErrorForCaller(context, @"SystemInfo", @"samplePrice", @"Cannot calculate sample price for destinations in other galaxies.");
return NO;
}
OOCreditsQuantity price = [[UNIVERSE commodities] samplePriceForCommodity:commodity inEconomy:[[thisInfo valueForKey:@"economy"] intValue] withScript:[thisInfo valueForKey:@"commodity_script"] inSystem:[thisInfo system]];
OOJS_RETURN_INT(price);
return JS_NewNumberValue(context, price, &OOJS_RVAL);
OOJS_NATIVE_EXIT
}