mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
Merge pull request #3646 from Undeemiss/contract-already-solved-check
CODINGCONTRACT: Fix #3391 Double contract reward exploit
This commit is contained in:
@@ -463,6 +463,12 @@ export class Terminal implements ITerminal {
|
|||||||
this.contractOpen = true;
|
this.contractOpen = true;
|
||||||
const res = await contract.prompt();
|
const res = await contract.prompt();
|
||||||
|
|
||||||
|
//Check if the contract still exists by the time the promise is fullfilled
|
||||||
|
if (serv.getContract(contractName) == null) {
|
||||||
|
this.contractOpen = false;
|
||||||
|
return this.error("Contract no longer exists (Was it solved by a script?)");
|
||||||
|
}
|
||||||
|
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case CodingContractResult.Success:
|
case CodingContractResult.Success:
|
||||||
if (contract.reward !== null) {
|
if (contract.reward !== null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user