mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-25 07:32:27 +01:00
make script base cost a constant
This commit is contained in:
parent
8dba456b65
commit
579a0aec55
@ -40,6 +40,7 @@ let CONSTANTS = {
|
|||||||
|
|
||||||
/* Netscript Constants */
|
/* Netscript Constants */
|
||||||
//RAM Costs for different commands
|
//RAM Costs for different commands
|
||||||
|
ScriptBaseRamCost: 1.4,
|
||||||
ScriptWhileRamCost: 0.2,
|
ScriptWhileRamCost: 0.2,
|
||||||
ScriptForRamCost: 0.2,
|
ScriptForRamCost: 0.2,
|
||||||
ScriptIfRamCost: 0.15,
|
ScriptIfRamCost: 0.15,
|
||||||
|
@ -417,7 +417,7 @@ function parseOnlyRamCalculate(server, code, workerScript) {
|
|||||||
|
|
||||||
// Finally, walk the reference map and generate a ram cost. The initial set of keys to scan
|
// Finally, walk the reference map and generate a ram cost. The initial set of keys to scan
|
||||||
// are those that start with __SPECIAL_INITIAL_MODULE__.
|
// are those that start with __SPECIAL_INITIAL_MODULE__.
|
||||||
let ram = 1.4;
|
let ram = CONSTANTS.ScriptBaseRamCost;
|
||||||
const unresolvedRefs = Object.keys(dependencyMap).filter(s => s.startsWith(initialModule));
|
const unresolvedRefs = Object.keys(dependencyMap).filter(s => s.startsWith(initialModule));
|
||||||
const resolvedRefs = new Set();
|
const resolvedRefs = new Set();
|
||||||
while (unresolvedRefs.length > 0) {
|
while (unresolvedRefs.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user