From 47c52c5d28d7a6643b13464155ee31ff1f3ed461 Mon Sep 17 00:00:00 2001 From: Marc Emmanuel Date: Sat, 28 Feb 2026 19:59:02 +0100 Subject: [PATCH] fix: clean up regiment notes and improve emblem retrieval logic --- src/modules/military-generator.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/military-generator.ts b/src/modules/military-generator.ts index 50a25fd9..da4970ab 100644 --- a/src/modules/military-generator.ts +++ b/src/modules/military-generator.ts @@ -487,6 +487,7 @@ class MilitaryModule { // remove all existing regiment notes before regenerating for (let i = notes.length - 1; i >= 0; i--) { if (notes[i].id.startsWith("regiment")) notes.splice(i, 1); + } // get regiments for each state valid.forEach((s) => { @@ -621,10 +622,10 @@ class MilitaryModule { ) return "👑"; // "Royal" regiment based in capital const mainUnit = Object.entries(r.u).sort((a, b) => b[1] - a[1])[0][0]; // unit with more troops in regiment + const unit = options.military.find( (u: { name: string; icon: string }) => u.name === mainUnit, ); return unit ? unit.icon : "⚔️"; - return unit.icon; } } window.Military = new MilitaryModule();