mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
fix a few bugs
This commit is contained in:
parent
7cc2a1b49a
commit
7cc4295c63
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1010,7 +1010,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
throw makeRuntimeErrorMsg("scp", "Only works for .script, .lit, and .txt files");
|
||||
}
|
||||
|
||||
let destServer, currServ;
|
||||
let destServer: BaseServer | null;
|
||||
let currServ: BaseServer | null;
|
||||
|
||||
if (hostname2 != null) {
|
||||
// 3 Argument version: scriptname, source, destination
|
||||
@ -1126,7 +1127,13 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
newScript.server = destServer.hostname;
|
||||
destServer.scripts.push(newScript);
|
||||
workerScript.log("scp", `File '${scriptname}' copied over to '${destServer.hostname}'.`);
|
||||
return Promise.resolve(true);
|
||||
return new Promise((resolve) => {
|
||||
if (destServer === null) {
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
newScript.updateRamUsage(destServer.scripts).then(() => resolve(true));
|
||||
});
|
||||
},
|
||||
ls: function (hostname: any, grep: any): any {
|
||||
updateDynamicRam("ls", getRamCost("ls"));
|
||||
|
@ -100,15 +100,15 @@ export function NetscriptFormulas(player: IPlayer, workerScript: WorkerScript, h
|
||||
},
|
||||
hackTime: function (server: any, player: any): any {
|
||||
checkFormulasAccess("basic.hackTime");
|
||||
return calculateHackingTime(server, player) / 1000;
|
||||
return calculateHackingTime(server, player) * 1000;
|
||||
},
|
||||
growTime: function (server: any, player: any): any {
|
||||
checkFormulasAccess("basic.growTime");
|
||||
return calculateGrowTime(server, player) / 1000;
|
||||
return calculateGrowTime(server, player) * 1000;
|
||||
},
|
||||
weakenTime: function (server: any, player: any): any {
|
||||
checkFormulasAccess("basic.weakenTime");
|
||||
return calculateWeakenTime(server, player) / 1000;
|
||||
return calculateWeakenTime(server, player) * 1000;
|
||||
},
|
||||
},
|
||||
hacknetNodes: {
|
||||
|
Loading…
Reference in New Issue
Block a user