mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 05:05:47 +01:00
Merge pull request #3646 from Undeemiss/contract-already-solved-check
CODINGCONTRACT: Fix #3391 Double contract reward exploit
This commit is contained in:
commit
d70d91b7b1
@ -463,6 +463,12 @@ export class Terminal implements ITerminal {
|
||||
this.contractOpen = true;
|
||||
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) {
|
||||
case CodingContractResult.Success:
|
||||
if (contract.reward !== null) {
|
||||
|
Loading…
Reference in New Issue
Block a user