mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-30 12:57:06 +02:00
Implemented several optimizations - running scripts dont keep track of script refs or a map of ALL servers. Not completely tested yet
This commit is contained in:
@@ -33,8 +33,10 @@ export function getPurchaseServerLimit() {
|
||||
}
|
||||
|
||||
export function getPurchaseServerMaxRam() {
|
||||
// TODO ensure this is a power of 2?
|
||||
return Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);
|
||||
const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);
|
||||
|
||||
// Round this to the nearest power of 2
|
||||
return 1 << 31 - Math.clz32(ram);
|
||||
}
|
||||
|
||||
// Manually purchase a server (NOT through Netscript)
|
||||
|
||||
Reference in New Issue
Block a user