diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index a0d1aa523..1335017f8 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -450,16 +450,16 @@ export function NetscriptSingularity(): InternalAPI { return false; } - if (Player.money < item.price) { - helpers.log(ctx, () => `Not enough money to purchase '${item.program}'. Need ${formatMoney(item.price)}`); - return false; - } - if (Player.hasProgram(item.program)) { helpers.log(ctx, () => `You already have the '${item.program}' program`); return true; } + if (Player.money < item.price) { + helpers.log(ctx, () => `Not enough money to purchase '${item.program}'. Need ${formatMoney(item.price)}`); + return false; + } + Player.getHomeComputer().pushProgram(item.program); // Cancel if the program is in progress of writing if (isCreateProgramWork(Player.currentWork) && Player.currentWork.programName === item.program) {