From 7008043c7a011960d2ad205dbac4e3a7646d7b80 Mon Sep 17 00:00:00 2001 From: gelzis Date: Wed, 1 Nov 2023 19:57:50 +0200 Subject: [PATCH] add support for underworld --- src/frontend/MartialPoints/OrderParser.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frontend/MartialPoints/OrderParser.ts b/src/frontend/MartialPoints/OrderParser.ts index 3f8aff1..1f9f6ab 100644 --- a/src/frontend/MartialPoints/OrderParser.ts +++ b/src/frontend/MartialPoints/OrderParser.ts @@ -19,16 +19,25 @@ export function getMartialPointsFromOrders(orders: string): MartialPointData { // matches ALH version // ;*** desert (3,1) - let matches = line.match(/;\*\*\* \w+ \((\d+),(\d+)\)/); + // also + // ;*** desert (3,1,underworld) + let matches = line.match(/;\*\*\* \w+ \((\d+),(\d+),?(\w+)?\)/); if (matches) { currentRegion = `${matches[1]},${matches[2]}`; + if (matches[3]) { + currentRegion += `,${matches[3]}`; + } } // matches advisor version // ; desert (3,1) in Great Boldur Desert - matches = line.match(/; \w+ \((\d+),(\d+)\)/); + // ; desert (3,1,underworld) in Great Boldur Desert + matches = line.match(/; \w+ \((\d+),(\d+),?(\w+)?\)/); if (matches) { currentRegion = `${matches[1]},${matches[2]}`; + if (matches[3]) { + currentRegion += `,${matches[3]}`; + } } const hasProduce = !!line.trim().match(/^[@]?produce/);