commit
ec2beb56a0
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "opt-cc",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.1",
|
||||
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
|
@ -417,7 +417,12 @@ const getBudgetEntry = (budg, warId, warDate) => {
|
|||
|
||||
const getPlayerInfoFromString = (inputString) => {
|
||||
const resPlayer = {};
|
||||
const playerNameRegexMatch = playerNameRegex.exec(inputString);
|
||||
let playerNameRegexMatch = playerNameRegex.exec(inputString);
|
||||
|
||||
// https://stackoverflow.com/questions/18462784/why-is-javascript-regex-matching-every-second-time
|
||||
if (!playerNameRegexMatch) {
|
||||
playerNameRegexMatch = playerNameRegex.exec(inputString);
|
||||
}
|
||||
const sideMatch = sideRegex.exec(inputString);
|
||||
|
||||
// SINGLE PLAYER NAME
|
||||
|
@ -426,11 +431,11 @@ const getPlayerInfoFromString = (inputString) => {
|
|||
name = playerNameRegexMatch[2].trim();
|
||||
// do not return player for 'unbekannt' or 'Error: No unit'
|
||||
if (!name || name === 'unbekannt' || name === 'Error: No unit' || name === 'Selbstverschulden.') {
|
||||
return;
|
||||
return {name: 'UNKNOWN', fraction: 'NONE'};
|
||||
}
|
||||
resPlayer.name = name;
|
||||
} else {
|
||||
return;
|
||||
return {name: 'UNKNOWN', fraction: 'NONE'};
|
||||
}
|
||||
|
||||
// ADDITIONAL PLAYER NAMES
|
||||
|
|
Loading…
Reference in New Issue