more fixes

This commit is contained in:
Olivier Gagnon
2021-11-26 18:54:06 -05:00
parent f17870926b
commit b941753e1b
3 changed files with 8 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ export function purchaseHacknet(player: IPlayer): number {
throw new Error(`Calculated cost of purchasing HacknetServer is NaN`);
}
if (!player.canAfford(cost)) {
if (!player.canAfford(cost) || numOwned >= HacknetServerConstants.MaxServers) {
return -1;
}
player.loseMoney(cost, "hacknet_expenses");