From 0abd760d359fc025f84d1daaf36df576a13b9a90 Mon Sep 17 00:00:00 2001 From: borisflagell Date: Tue, 24 May 2022 15:38:05 +0200 Subject: [PATCH 1/2] API FIX:#3732 Cannot assign two sleeve on "Take on contracts" regardless of contract type. ns.sleeve.setToBladeburnerAction() was not testing the contract value. --- src/NetscriptFunctions/Sleeve.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NetscriptFunctions/Sleeve.ts b/src/NetscriptFunctions/Sleeve.ts index bd3c604bd..544a62f70 100644 --- a/src/NetscriptFunctions/Sleeve.ts +++ b/src/NetscriptFunctions/Sleeve.ts @@ -332,7 +332,11 @@ export function NetscriptSleeve(player: IPlayer): InternalAPI { continue; } const other = player.sleeves[i]; - if (other.currentTask === SleeveTaskType.Bladeburner && other.bbAction === action) { + if ( + other.currentTask === SleeveTaskType.Bladeburner && + other.bbAction === action && + other.bbContract === contract + ) { throw ctx.helper.makeRuntimeErrorMsg( `Sleeve ${sleeveNumber} cannot take of contracts because Sleeve ${i} is already performing that action.`, ); From c5b68610a1c84b0831c5a965397fbc618d49949e Mon Sep 17 00:00:00 2001 From: borisflagell Date: Fri, 27 May 2022 17:59:37 +0200 Subject: [PATCH 2/2] fix typo in thrown error message --- src/NetscriptFunctions/Sleeve.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NetscriptFunctions/Sleeve.ts b/src/NetscriptFunctions/Sleeve.ts index 544a62f70..9275c0cce 100644 --- a/src/NetscriptFunctions/Sleeve.ts +++ b/src/NetscriptFunctions/Sleeve.ts @@ -338,7 +338,7 @@ export function NetscriptSleeve(player: IPlayer): InternalAPI { other.bbContract === contract ) { throw ctx.helper.makeRuntimeErrorMsg( - `Sleeve ${sleeveNumber} cannot take of contracts because Sleeve ${i} is already performing that action.`, + `Sleeve ${sleeveNumber} cannot take on contracts because Sleeve ${i} is already performing that action.`, ); } }