mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +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.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;
|
||||
} // Safety check
|
||||
|
||||
@@ -289,7 +289,7 @@ export class Terminal {
|
||||
const newSec = server.hackDifficulty;
|
||||
|
||||
this.print(
|
||||
`Hack successful on '${server.hostname}'! Gained ${formatMoney(moneyGained)} and ${formatExp(
|
||||
`Hack successful on '${server.hostname}'! Gained ${formatMoney(moneyGained, true)} and ${formatExp(
|
||||
expGainedOnSuccess,
|
||||
)} hacking exp`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user