mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Fix some misleading corporation errors
This commit is contained in:
parent
e704843d91
commit
208af6ce9c
@ -119,17 +119,17 @@ export function SellMaterial(mat: Material, amt: string, price: string): void {
|
||||
try {
|
||||
tempQty = eval(tempQty);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid value or expression for sell price field: " + e);
|
||||
throw new Error("Invalid value or expression for sell quantity field: " + e);
|
||||
}
|
||||
|
||||
if (tempQty == null || isNaN(parseFloat(tempQty)) || parseFloat(tempQty) < 0) {
|
||||
throw new Error("Invalid value or expression for sell price field");
|
||||
throw new Error("Invalid value or expression for sell quantity field");
|
||||
}
|
||||
|
||||
mat.sllman[0] = true;
|
||||
mat.sllman[1] = q; //Use sanitized input
|
||||
} else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {
|
||||
throw new Error("Invalid value for sell quantity field! Must be numeric or 'MAX'");
|
||||
throw new Error("Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'");
|
||||
} else {
|
||||
let q = parseFloat(amt);
|
||||
if (isNaN(q)) {
|
||||
@ -156,10 +156,10 @@ export function SellProduct(product: Product, city: string, amt: string, price:
|
||||
try {
|
||||
temp = eval(temp);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid value or expression for sell quantity field: " + e);
|
||||
throw new Error("Invalid value or expression for sell price field: " + e);
|
||||
}
|
||||
if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {
|
||||
throw new Error("Invalid value or expression for sell quantity field.");
|
||||
throw new Error("Invalid value or expression for sell price field.");
|
||||
}
|
||||
product.sCost = price; //Use sanitized price
|
||||
} else {
|
||||
@ -184,11 +184,11 @@ export function SellProduct(product: Product, city: string, amt: string, price:
|
||||
try {
|
||||
temp = eval(temp);
|
||||
} catch (e) {
|
||||
throw new Error("Invalid value or expression for sell price field: " + e);
|
||||
throw new Error("Invalid value or expression for sell quantity field: " + e);
|
||||
}
|
||||
|
||||
if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {
|
||||
throw new Error("Invalid value or expression for sell price field");
|
||||
throw new Error("Invalid value or expression for sell quantity field");
|
||||
}
|
||||
if (all) {
|
||||
for (let i = 0; i < cities.length; ++i) {
|
||||
@ -201,7 +201,7 @@ export function SellProduct(product: Product, city: string, amt: string, price:
|
||||
product.sllman[city][1] = qty; //Use sanitized input
|
||||
}
|
||||
} else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {
|
||||
throw new Error("Invalid value for sell quantity field! Must be numeric");
|
||||
throw new Error("Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'");
|
||||
} else {
|
||||
let qty = parseFloat(amt);
|
||||
if (isNaN(qty)) {
|
||||
|
Loading…
Reference in New Issue
Block a user