For test results, bug reports, announcements of new builds etc.
Moderators: winston , another_commander , Getafix
Milo
---- E L I T E ----
Posts: 462 Joined: Mon Sep 17, 2018 5:01 pm
Post
by Milo » Wed Jul 22, 2020 2:13 pm
The string passed to OOJSReportBadArguments at line 390 of OOJSGlobal.m is inconsistent with the method calling it:
displayNameForCommodity should be
randomInhabitantsDescription
Code: Select all
// randomInhabitantsDescription() : String
static JSBool GlobalRandomInhabitantsDescription(JSContext *context, uintN argc, jsval *vp)
{
OOJS_NATIVE_ENTER(context)
NSString *string = nil;
Random_Seed aSeed;
JSBool isPlural = YES;
if (argc > 0 && !JS_ValueToBoolean(context, OOJS_ARGV[0], &isPlural))
{
OOJSReportBadArguments(context, nil, @"displayNameForCommodity", 1, OOJS_ARGV, nil, @"boolean");
return NO;
}
make_pseudo_random_seed(&aSeed);
string = [UNIVERSE getSystemInhabitants:Ranrot()%OO_SYSTEMS_PER_GALAXY plural:isPlural];
OOJS_RETURN_OBJECT(string);
OOJS_NATIVE_EXIT
}
phkb
Impressively Grand Sub-Admiral
Posts: 4891 Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.
Post
by phkb » Wed Jul 22, 2020 5:40 pm
Milo
---- E L I T E ----
Posts: 462 Joined: Mon Sep 17, 2018 5:01 pm
Post
by Milo » Wed Jul 22, 2020 5:49 pm
Actually, is the condition surrounding that log message correct? I guess it is, but the function syntax comment above the function definition wasn’t updated to reflect the optional parameter.