CONTRACTS: Display contract answers on completely failed contracts (#2440)

This commit is contained in:
Adam Weeden
2026-01-08 16:21:52 -05:00
committed by GitHub
parent edf3d11b72
commit 7af9dca6bc
23 changed files with 221 additions and 48 deletions
+4
View File
@@ -55,6 +55,10 @@ export function NetscriptCodingContract(): InternalAPI<ICodingContract> {
case CodingContractResult.Failure: {
if (++contract.tries >= contract.getMaxNumTries()) {
helpers.log(ctx, () => `Coding Contract attempt '${contract.fn}' failed. Contract is now self-destructing`);
const solution = contract.getAnswer();
if (solution !== null) {
helpers.log(ctx, () => `Coding Contract solution was: ${solution}`);
}
server.removeContract(contract.fn);
} else {
helpers.log(