CLI: Do not round down amount of hacked money in "hack" CLI (#2344)

This commit is contained in:
catloversg
2025-10-11 00:38:50 +07:00
committed by GitHub
parent 5c0f24f5d0
commit bd4e34fae0

View File

@@ -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`,
);