mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 19:37:07 +02:00
fix sleeve memory bug
This commit is contained in:
@@ -2,11 +2,7 @@
|
||||
* This is an object that is used to keep track of where all of the player's
|
||||
* money is coming from (or going to)
|
||||
*/
|
||||
import {
|
||||
Generic_fromJSON,
|
||||
Generic_toJSON,
|
||||
Reviver,
|
||||
} from "../../utils/JSONReviver";
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver";
|
||||
|
||||
export class MoneySourceTracker {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
@@ -32,9 +28,7 @@ export class MoneySourceTracker {
|
||||
record(amt: number, source: string): void {
|
||||
const sanitizedSource = source.toLowerCase();
|
||||
if (typeof this[sanitizedSource] !== "number") {
|
||||
console.warn(
|
||||
`MoneySourceTracker.record() called with invalid source: ${source}`,
|
||||
);
|
||||
console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,20 +16,12 @@
|
||||
* can be called with the stat and the exponential/linear factors. The other is a
|
||||
* class where the exponential and linear factors are defined upon construction.
|
||||
*/
|
||||
export function calculateEffectWithFactors(
|
||||
n: number,
|
||||
expFac: number,
|
||||
linearFac: number,
|
||||
): number {
|
||||
export function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {
|
||||
if (expFac <= 0 || expFac >= 1) {
|
||||
console.warn(
|
||||
`Exponential factor is ${expFac}. This is not an intended value for it`,
|
||||
);
|
||||
console.warn(`Exponential factor is ${expFac}. This is not an intended value for it`);
|
||||
}
|
||||
if (linearFac < 1) {
|
||||
console.warn(
|
||||
`Linear factor is ${linearFac}. This is not an intended value for it`,
|
||||
);
|
||||
console.warn(`Linear factor is ${linearFac}. This is not an intended value for it`);
|
||||
}
|
||||
|
||||
return Math.pow(n, expFac) + n / linearFac;
|
||||
|
||||
Reference in New Issue
Block a user