mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 11:10:58 +02:00
BUGFIX: Duplicated program in edge case (#1549)
This commit is contained in:
@@ -18,12 +18,13 @@ export function ProgramsDev(): React.ReactElement {
|
||||
setProgram(event.target.value as CompletedProgramName);
|
||||
}
|
||||
function addProgram(): void {
|
||||
if (!Player.hasProgram(program)) Player.getHomeComputer().programs.push(program);
|
||||
Player.getHomeComputer().pushProgram(program);
|
||||
}
|
||||
|
||||
function addAllPrograms(): void {
|
||||
const home = Player.getHomeComputer();
|
||||
for (const name of Object.values(CompletedProgramName)) {
|
||||
if (!Player.hasProgram(name)) Player.getHomeComputer().programs.push(name);
|
||||
home.pushProgram(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user