mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
Added a check to prevent doubling coding contract rewards
This commit is contained in:
parent
f5f5879fc3
commit
a23c55c760
@ -284,7 +284,7 @@ export class Terminal implements ITerminal {
|
|||||||
`Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(
|
`Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(
|
||||||
oldSec,
|
oldSec,
|
||||||
)} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +
|
)} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +
|
||||||
` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,
|
` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,8 +330,7 @@ export class Terminal implements ITerminal {
|
|||||||
this.print("Time to hack: " + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : "N/A"));
|
this.print("Time to hack: " + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : "N/A"));
|
||||||
}
|
}
|
||||||
this.print(
|
this.print(
|
||||||
`Total money available on server: ${
|
`Total money available on server: ${currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : "N/A"
|
||||||
currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : "N/A"
|
|
||||||
}`,
|
}`,
|
||||||
);
|
);
|
||||||
if (currServ instanceof Server) {
|
if (currServ instanceof Server) {
|
||||||
@ -463,6 +462,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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user