From d8618948ceafd59b516a8a5f4da0da347184bd88 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Wed, 24 Feb 2021 17:33:01 +0300 Subject: [PATCH] v1.5.55 - fix for burgs without valid states --- modules/ui/tools.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ui/tools.js b/modules/ui/tools.js index 51abcab0..8277e4ab 100644 --- a/modules/ui/tools.js +++ b/modules/ui/tools.js @@ -299,12 +299,12 @@ function regenerateEmblems() { if (!burg.i || burg.removed) return; const state = pack.states[burg.state]; - let kinship = .25; + let kinship = state ? .25 : 0; if (burg.capital) kinship += .1; else if (burg.port) kinship -= .1; - if (burg.culture !== state.culture) kinship -= .25; - burg.coa = COA.generate(state.coa, kinship, null, burg.type); - burg.coa.shield = COA.getShield(burg.culture, burg.state); + if (state && burg.culture !== state.culture) kinship -= .25; + burg.coa = COA.generate(state ? state.coa : null, kinship, null, burg.type); + burg.coa.shield = COA.getShield(burg.culture, state ? burg.state || 0); }); pack.provinces.forEach(province => {