mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 08:42:53 +02:00
BUGFIX: Duplicated program in edge case (#1549)
This commit is contained in:
@@ -87,14 +87,12 @@ export class CreateProgramWork extends Work {
|
||||
dialogBoxCreate(lines.join("\n"));
|
||||
}
|
||||
|
||||
if (!Player.getHomeComputer().programs.includes(programName)) {
|
||||
Player.getHomeComputer().programs.push(programName);
|
||||
}
|
||||
Player.getHomeComputer().pushProgram(programName);
|
||||
} else if (!Player.getHomeComputer().programs.includes(programName)) {
|
||||
//Incomplete case
|
||||
const perc = ((100 * this.unitCompleted) / this.unitNeeded()).toFixed(2);
|
||||
const incompleteName = asProgramFilePath(programName + "-" + perc + "%-INC");
|
||||
Player.getHomeComputer().programs.push(incompleteName);
|
||||
Player.getHomeComputer().pushProgram(incompleteName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user