learning ts

forgot a return type, all better now, we hope....
This commit is contained in:
zeddrak 2022-01-28 15:34:39 -08:00 committed by GitHub
parent 1b81aa2533
commit ecdde9c96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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