mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
Fix script needlessly being recompiled (#932)
* Fix nsjs recompiling needlesly.
This commit is contained in:
@@ -1453,6 +1453,11 @@ function NetscriptFunctions(workerScript) {
|
||||
if (scriptname == destServer.scripts[i].filename) {
|
||||
workerScript.log("scp", `WARNING: File '${scriptname}' overwritten on '${destServer.hostname}'`);
|
||||
const oldScript = destServer.scripts[i];
|
||||
// If it's the exact same file don't actually perform the
|
||||
// copy to avoid recompiling uselessly. Players tend to scp
|
||||
// liberally.
|
||||
if(oldScript.code === sourceScript.code)
|
||||
return true;
|
||||
oldScript.code = sourceScript.code;
|
||||
oldScript.ramUsage = sourceScript.ramUsage;
|
||||
oldScript.markUpdated();
|
||||
|
||||
Reference in New Issue
Block a user