mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-28 08:57:32 +01:00
learning ts
forgot a return type, all better now, we hope....
This commit is contained in:
parent
1b81aa2533
commit
ecdde9c96c
@ -146,7 +146,7 @@ export function numCycleForGrowthCorrected(server: Server, targetMoney: number,
|
||||
* @param p - Reference to Player object
|
||||
* @returns Number of "growth cycles" needed to reverse the described hack
|
||||
*/
|
||||
export function numCycleForGrowthByHackAmt(server: Server, hackAmt: number, prehackMoney: number, p: IPlayer, cores = 1) {
|
||||
export function numCycleForGrowthByHackAmt(server: Server, hackAmt: number, prehackMoney: number, p: IPlayer, cores = 1): number{
|
||||
if (prehackMoney > server.moneyMax) { prehackMoney = server.moneyMax; }
|
||||
const posthackAmt = Math.floor(prehackMoney * Math.min(1, Math.max(0, (1 - hackAmt))));
|
||||
return numCycleForGrowthCorrected(server, prehackMoney, posthackAmt, p, cores);
|
||||
|
Loading…
Reference in New Issue
Block a user