diff --git a/src/quickjs_backend.cpp b/src/quickjs_backend.cpp index 5b40ab03688..4f08002cf3d 100644 --- a/src/quickjs_backend.cpp +++ b/src/quickjs_backend.cpp @@ -756,6 +756,7 @@ static int QuickJS_DefinePropertyValue(JSContext *ctx, JSValueConst this_obj, co //;; * ```name``` A string containing the full name of the research. //;; * ```id``` A string containing the index name of the research. //;; * ```type``` The type will always be ```RESEARCH_DATA```. +//;; * ```results``` An array of objects of research upgrades (defined in "research.json"). //;; JSValue convResearch(const RESEARCH *psResearch, JSContext *ctx, int player) { @@ -781,7 +782,7 @@ JSValue convResearch(const RESEARCH *psResearch, JSContext *ctx, int player) QuickJS_DefinePropertyValue(ctx, value, "name", JS_NewString(ctx, psResearch->id.toUtf8().c_str()), JS_PROP_ENUMERABLE); // will be changed to contain fullname QuickJS_DefinePropertyValue(ctx, value, "id", JS_NewString(ctx, psResearch->id.toUtf8().c_str()), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "type", JS_NewInt32(ctx, SCRIPT_RESEARCH), JS_PROP_ENUMERABLE); - QuickJS_DefinePropertyValue(ctx, value, "results", mapJsonToQuickJSValue(ctx, psResearch->results, 0), JS_PROP_ENUMERABLE); + QuickJS_DefinePropertyValue(ctx, value, "results", mapJsonToQuickJSValue(ctx, psResearch->results, JS_PROP_ENUMERABLE), JS_PROP_ENUMERABLE); return value; }