mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Merge pull request #4082 from Snarling/tailRamExploitFix
SCRIPTS: FIX #4081 Rerunning a script from tail window recalculates ram usage
This commit is contained in:
commit
5d6eed2b4d
@ -393,10 +393,9 @@ function createAndAddWorkerScript(runningScriptObj: RunningScript, server: BaseS
|
|||||||
const ramAvailable = server.maxRam - server.ramUsed;
|
const ramAvailable = server.maxRam - server.ramUsed;
|
||||||
if (ramUsage > ramAvailable + 0.001) {
|
if (ramUsage > ramAvailable + 0.001) {
|
||||||
dialogBoxCreate(
|
dialogBoxCreate(
|
||||||
`Not enough RAM to run script ${runningScriptObj.filename} with args ` +
|
`Not enough RAM to run script ${runningScriptObj.filename} with args ${arrayToString(runningScriptObj.args)}.\n` +
|
||||||
`${arrayToString(runningScriptObj.args)}. This likely occurred because you re-loaded ` +
|
`This can occur when you reload the game and the script's RAM usage has increased (either because of an update to the game or ` +
|
||||||
`the game and the script's RAM usage increased (either because of an update to the game or ` +
|
`your changes to the script).\nThis can also occur if you have attempted to launch a script from a tail window with insufficient RAM. `,
|
||||||
`your changes to the script.)`,
|
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -213,6 +213,7 @@ function LogWindow(props: IProps): React.ReactElement {
|
|||||||
if (server === null) return;
|
if (server === null) return;
|
||||||
const s = findRunningScript(script.filename, script.args, server);
|
const s = findRunningScript(script.filename, script.args, server);
|
||||||
if (s === null) {
|
if (s === null) {
|
||||||
|
script.ramUsage = 0;
|
||||||
startWorkerScript(script, server);
|
startWorkerScript(script, server);
|
||||||
} else {
|
} else {
|
||||||
setScript(s);
|
setScript(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user