mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-14 14:22:32 +01:00
corp MAXMPPROD is now case insensitive
This commit is contained in:
@ -105,6 +105,7 @@ export function SellMaterial(mat: Material, amt: string, price: string): void {
|
||||
}
|
||||
|
||||
//Parse quantity
|
||||
amt = amt.toUpperCase();
|
||||
if (amt.includes("MAX") || amt.includes("PROD")) {
|
||||
let q = amt.replace(/\s+/g, "");
|
||||
q = q.replace(/[^-()\d/*+.MAXPROD]/g, "");
|
||||
@ -168,6 +169,7 @@ export function SellProduct(product: Product, city: string, amt: string, price:
|
||||
const cities = Object.keys(Cities);
|
||||
|
||||
// Parse quantity
|
||||
amt = amt.toUpperCase();
|
||||
if (amt.includes("MAX") || amt.includes("PROD")) {
|
||||
//Dynamically evaluated quantity. First test to make sure its valid
|
||||
let qty = amt.replace(/\s+/g, "");
|
||||
@ -372,7 +374,7 @@ export function Research(division: IIndustry, researchName: string): void {
|
||||
|
||||
export function ExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {
|
||||
// Sanitize amt
|
||||
let sanitizedAmt = amt.replace(/\s+/g, "");
|
||||
let sanitizedAmt = amt.replace(/\s+/g, "").toUpperCase();
|
||||
sanitizedAmt = sanitizedAmt.replace(/[^-()\d/*+.MAX]/g, "");
|
||||
let temp = sanitizedAmt.replace(/MAX/g, "1");
|
||||
try {
|
||||
|
@ -840,7 +840,7 @@ export class Industry implements IIndustry {
|
||||
let sellAmt;
|
||||
if (isString(mat.sllman[1])) {
|
||||
//Dynamically evaluated
|
||||
let tmp = (mat.sllman[1] as string).replace(/MAX/g, maxSell + "");
|
||||
let tmp = (mat.sllman[1] as string).replace(/MAX/g, (maxSell + "").toUpperCase());
|
||||
tmp = tmp.replace(/PROD/g, mat.prd + "");
|
||||
try {
|
||||
sellAmt = eval(tmp);
|
||||
@ -893,7 +893,7 @@ export class Industry implements IIndustry {
|
||||
const exp = mat.exp[expI];
|
||||
const amtStr = exp.amt.replace(
|
||||
/MAX/g,
|
||||
mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + "",
|
||||
(mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + "").toUpperCase(),
|
||||
);
|
||||
let amt = 0;
|
||||
try {
|
||||
@ -1201,7 +1201,7 @@ export class Industry implements IIndustry {
|
||||
let sellAmt;
|
||||
if (product.sllman[city][0] && isString(product.sllman[city][1])) {
|
||||
//Sell amount is dynamically evaluated
|
||||
let tmp = product.sllman[city][1].replace(/MAX/g, maxSell);
|
||||
let tmp = product.sllman[city][1].replace(/MAX/g, (maxSell + "").toUpperCase());
|
||||
tmp = tmp.replace(/PROD/g, product.data[city][1]);
|
||||
try {
|
||||
tmp = eval(tmp);
|
||||
|
Reference in New Issue
Block a user