Fixed bug with purchasing NeuroFlux using purchaseAugmentation() Singularity fn

This commit is contained in:
danielyxie 2017-09-08 14:16:48 -05:00
parent 787e2027f5
commit 19b861c4f7
2 changed files with 34 additions and 19 deletions

7
dist/bundle.js vendored

@ -36506,6 +36506,12 @@ function NetscriptFunctions(workerScript) {
return false; return false;
} }
var isNeuroflux = false;
if (aug.name === __WEBPACK_IMPORTED_MODULE_0__Augmentations_js__["b" /* AugmentationNames */].NeuroFluxGovernor) {
isNeuroflux = true;
}
if (!isNeuroflux) {
for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_10__Player_js__["a" /* Player */].queuedAugmentations.length; ++j) { for (var j = 0; j < __WEBPACK_IMPORTED_MODULE_10__Player_js__["a" /* Player */].queuedAugmentations.length; ++j) {
if (__WEBPACK_IMPORTED_MODULE_10__Player_js__["a" /* Player */].queuedAugmentations[j].name === aug.name) { if (__WEBPACK_IMPORTED_MODULE_10__Player_js__["a" /* Player */].queuedAugmentations[j].name === aug.name) {
workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you already have " + name); workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you already have " + name);
@ -36518,6 +36524,7 @@ function NetscriptFunctions(workerScript) {
return false; return false;
} }
} }
}
if (fac.playerReputation < aug.baseRepRequirement) { if (fac.playerReputation < aug.baseRepRequirement) {
workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you do not have enough reputation with " + fac.name); workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you do not have enough reputation with " + fac.name);

@ -1,5 +1,6 @@
import {Augmentations, Augmentation, import {Augmentations, Augmentation,
augmentationExists, installAugmentations} from "./Augmentations.js"; augmentationExists, installAugmentations,
AugmentationNames} from "./Augmentations.js";
import {Companies, Company, CompanyPosition, import {Companies, Company, CompanyPosition,
CompanyPositions, companyExists} from "./Company.js"; CompanyPositions, companyExists} from "./Company.js";
import {CONSTANTS} from "./Constants.js"; import {CONSTANTS} from "./Constants.js";
@ -1753,6 +1754,12 @@ function NetscriptFunctions(workerScript) {
return false; return false;
} }
var isNeuroflux = false;
if (aug.name === AugmentationNames.NeuroFluxGovernor) {
isNeuroflux = true;
}
if (!isNeuroflux) {
for (var j = 0; j < Player.queuedAugmentations.length; ++j) { for (var j = 0; j < Player.queuedAugmentations.length; ++j) {
if (Player.queuedAugmentations[j].name === aug.name) { if (Player.queuedAugmentations[j].name === aug.name) {
workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you already have " + name); workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you already have " + name);
@ -1765,6 +1772,7 @@ function NetscriptFunctions(workerScript) {
return false; return false;
} }
} }
}
if (fac.playerReputation < aug.baseRepRequirement) { if (fac.playerReputation < aug.baseRepRequirement) {
workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you do not have enough reputation with " + fac.name); workerScript.scriptRef.log("ERROR: purchaseAugmentation() failed because you do not have enough reputation with " + fac.name);