Fix parsing for vehicle info
parent
b1cc8a8f9a
commit
c14b33f9c5
|
@ -78,7 +78,7 @@ const parseWarLog = (lineArray, war) => {
|
|||
});
|
||||
}
|
||||
} else {
|
||||
const targetString = line.substring(line.lastIndexOf(' --- ') + 5, line.lastIndexOf(' von:'));
|
||||
const targetString = line.substring(line.lastIndexOf(' --- Einheit: ') + 14, line.lastIndexOf(' von:'));
|
||||
const target = getPlayerAndFractionFromString(targetString);
|
||||
stats.kills.push({
|
||||
war: war._id,
|
||||
|
@ -277,11 +277,12 @@ const getPlayerAndFractionFromString = (nameAndFractionString) => {
|
|||
|
||||
const getVehicleAndFractionFromString = (nameClassFractionString) => {
|
||||
const nameArray = nameClassFractionString.trim().split(WHITESPACE);
|
||||
|
||||
const vehicleFraction = nameArray[nameArray.length - 1];
|
||||
const vehicleFraction = nameArray[nameArray.length - 1].slice(0,-1);
|
||||
nameArray.pop();
|
||||
nameArray.pop();
|
||||
const vehicleClassString = nameArray[nameArray.length - 1].replace('(', '').replace(')', '');
|
||||
nameArray.pop();
|
||||
nameArray.pop();
|
||||
const vehicleName = nameArray.join(WHITESPACE);
|
||||
|
||||
// skip logging here - this is some basic equipment identifier (i.e. parachute)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "opt-cc",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue