mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 03:25:44 +02:00
CLI: Do not round down amount of hacked money in "hack" CLI (#2344)
This commit is contained in:
@@ -266,9 +266,9 @@ export class Terminal {
|
|||||||
Engine.Counters.checkFactionInvitations = 0;
|
Engine.Counters.checkFactionInvitations = 0;
|
||||||
Engine.checkCounters();
|
Engine.checkCounters();
|
||||||
|
|
||||||
let moneyDrained = Math.floor(server.moneyAvailable * calculatePercentMoneyHacked(server, Player));
|
let moneyDrained = server.moneyAvailable * calculatePercentMoneyHacked(server, Player);
|
||||||
|
|
||||||
if (moneyDrained <= 0) {
|
if (moneyDrained < 0) {
|
||||||
moneyDrained = 0;
|
moneyDrained = 0;
|
||||||
} // Safety check
|
} // Safety check
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ export class Terminal {
|
|||||||
const newSec = server.hackDifficulty;
|
const newSec = server.hackDifficulty;
|
||||||
|
|
||||||
this.print(
|
this.print(
|
||||||
`Hack successful on '${server.hostname}'! Gained ${formatMoney(moneyGained)} and ${formatExp(
|
`Hack successful on '${server.hostname}'! Gained ${formatMoney(moneyGained, true)} and ${formatExp(
|
||||||
expGainedOnSuccess,
|
expGainedOnSuccess,
|
||||||
)} hacking exp`,
|
)} hacking exp`,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user