MISC: Print logs when ns.hacknet.spendHashes fails and update param type of APIs using hash upgrade (#2145)

This commit is contained in:
catloversg
2025-05-21 22:38:39 +07:00
committed by GitHub
parent 90555a64e6
commit 47153bd31c
19 changed files with 252 additions and 197 deletions
+1 -1
View File
@@ -330,7 +330,7 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
return HScalculateCacheUpgradeCost(startingCache, extraCache);
},
hashUpgradeCost: (ctx) => (_upgName, _level) => {
const upgName = helpers.string(ctx, "upgName", _upgName);
const upgName = getEnumHelper("HashUpgradeEnum").nsGetMember(ctx, _upgName);
const level = helpers.number(ctx, "level", _level);
checkFormulasAccess(ctx);
const upg = Player.hashManager.getUpgrade(upgName);