mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Fix args for ns1
This commit is contained in:
parent
9820f9e24a
commit
70b8be9988
@ -82,6 +82,7 @@ async function startNetscript1Script(workerScript: WorkerScript): Promise<void>
|
|||||||
//TODO unplanned: Make NS1 wrapping type safe instead of using BasicObject.
|
//TODO unplanned: Make NS1 wrapping type safe instead of using BasicObject.
|
||||||
type BasicObject = Record<string, any>;
|
type BasicObject = Record<string, any>;
|
||||||
function wrapNS1Layer(int: Interpreter, intLayer: unknown, nsLayer = wrappedNS as BasicObject) {
|
function wrapNS1Layer(int: Interpreter, intLayer: unknown, nsLayer = wrappedNS as BasicObject) {
|
||||||
|
if (nsLayer === wrappedNS) int.setProperty(intLayer, "args", int.nativeToPseudo(workerScript.args));
|
||||||
for (const [name, entry] of Object.entries(nsLayer)) {
|
for (const [name, entry] of Object.entries(nsLayer)) {
|
||||||
if (typeof entry === "function") {
|
if (typeof entry === "function") {
|
||||||
const wrapper = async (...args: unknown[]) => {
|
const wrapper = async (...args: unknown[]) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user