Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion public/modules/military-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ window.Military = (function () {
const expected = 3 * populationRate; // expected regiment size
const mergeable = (n0, n1) => (!n0.s && !n1.s) || n0.u === n1.u; // check if regiments can be merged

// 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 => {
s.military = createRegiments(s.temp.platoons, s);
Expand Down Expand Up @@ -380,7 +385,14 @@ window.Military = (function () {
: gauss(options.year - 100, 150, 1, options.year - 6);
const conflict = campaign ? ` during the ${campaign.name}` : "";
const legend = `Regiment was formed in ${year} ${options.era}${conflict}. ${station}${troops}`;
notes.push({id: `regiment${s.i}-${r.i}`, name: r.name, legend});
const id = `regiment${s.i}-${r.i}`;
const existing = notes.find(n => n.id === id);
if (existing) {
existing.name = r.name;
existing.legend = legend;
} else {
notes.push({id, name: r.name, legend});
}
Comment thread
Azgaar marked this conversation as resolved.
};

return {
Expand Down
2 changes: 1 addition & 1 deletion public/versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Example: 1.102.2 -> Major version 1, Minor version 102, Patch version 2
*/

const VERSION = "1.112.2";
const VERSION = "1.112.3";
if (parseMapVersion(VERSION) !== VERSION) alert("versioning.js: Invalid format or parsing function");

{
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8494,7 +8494,7 @@

<script defer src="config/heightmap-templates.js"></script>
<script defer src="config/precreated-heightmaps.js"></script>
<script defer src="modules/military-generator.js?v=1.107.0"></script>
<script defer src="modules/military-generator.js?v=1.112.3"></script>
<script defer src="modules/resample.js?v=1.112.1"></script>
<script defer src="libs/alea.min.js?v1.105.0"></script>
<script defer src="libs/polylabel.min.js?v1.105.0"></script>
Expand Down