Fix point string resolve for OPFOR in default PUNKTE entry

pull/44/head
HardiReady 2018-08-13 19:07:23 +02:00
parent 3adc751ac8
commit 854a9720f5
1 changed files with 5 additions and 2 deletions

View File

@ -172,6 +172,7 @@ const parseWarLog = (lineArray, war) => {
* POINTS
*/
stats.clean.push(line);
const pt = line.split(WHITESPACE);
if (line.includes('Endpunktestand')) {
@ -180,6 +181,8 @@ const parseWarLog = (lineArray, war) => {
// EXIT LOOP
return true;
} else {
console.log(getPointsEntry(pt, line, war._id, war.date))
stats.points.push(getPointsEntry(pt, line, war._id, war.date));
}
} else if (line.includes('(Revive)')) {
@ -221,7 +224,7 @@ const parseWarLog = (lineArray, war) => {
fraction: driver ? driver.fraction : 'NONE',
distance: distance,
});
} else if (line.includes('(Fraktionsuebersicht)')) {
} else if (line.includes('(Fraktionsuebersicht)') || line.includes('Fraktionsübersicht')) {
/**
* PLAYERS
*/
@ -287,7 +290,7 @@ const getPointsEntry = (pt, line, warId, warDate) => {
war: warId,
time: getFullTimeDate(warDate, pt[5]),
ptBlufor: parseInt(pt[10]),
ptOpfor: parseInt(pt[13].slice(0, -3)),
ptOpfor: parseInt(pt[13].slice(0, -2)),
fraction: line.includes('Kein Dominator') ? 'NONE' : line.includes('NATO +1') ? 'BLUFOR' : 'OPFOR',
};
};