diff --git a/src/Corporation/Actions.ts b/src/Corporation/Actions.ts index ab217d843..03f937e08 100644 --- a/src/Corporation/Actions.ts +++ b/src/Corporation/Actions.ts @@ -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)) {