mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 20:55:44 +01:00
fix player input parsing for coding contracts that accept arrays of strings (#937)
This commit is contained in:
parent
8742df9588
commit
0da9d9d3c0
@ -1162,7 +1162,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);
|
||||
const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(",");
|
||||
for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {
|
||||
sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\s/g, "");
|
||||
sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i].replace(/\s/g, ""));
|
||||
}
|
||||
|
||||
if (sanitizedPlayerAnsArr.length !== res.length) {
|
||||
@ -1264,7 +1264,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
// Don't include any "" entries in the parsed array
|
||||
const sanitizedPlayerAnsArr: string[] = filterTruthy(sanitizedPlayerAns.split(","));
|
||||
for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {
|
||||
sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\s/g, "");
|
||||
sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i].replace(/\s/g, ""));
|
||||
}
|
||||
|
||||
if (num == null || num.length === 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user