summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-11 23:21:35 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commitdad759f1d6f0829b020700f57e6bdf17c7bd6f6f (patch)
tree6b99aaf6ab60761d1e52ca09a2dbbfc293e0356e /rules.js
parentdd744cc6e79ac604253981957210f383e9b7c4a5 (diff)
downloadplantagenet-dad759f1d6f0829b020700f57e6bdf17c7bd6f6f.tar.gz
Fix for loops < last_thing to <= last thing
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 8df8e9a..a8ffc8d 100644
--- a/rules.js
+++ b/rules.js
@@ -1299,7 +1299,7 @@ function get_vassal_service(vassal) {
}
function setup_vassals(excludes = []) {
- for (let x = first_vassal; x < last_vassal; x++) {
+ for (let x = first_vassal; x <= last_vassal; x++) {
if (!excludes.includes(x) && data.vassals[x].capability === undefined) {
set_vassal_lord_and_service(x, VASSAL_READY, 0)
}
@@ -1327,14 +1327,14 @@ function is_vassal_mustered_with_york_lord(x) {
}
function for_each_vassal_with_lord(lord, f) {
- for (let x = first_vassal; x < last_vassal; x++)
+ for (let x = first_vassal; x <= last_vassal; x++)
if (is_vassal_mustered_with(x, lord))
f(x)
}
function count_vassals_with_lord(lord) {
let n = 0
- for (let x = first_vassal; x < last_vassal; x++)
+ for (let x = first_vassal; x <= last_vassal; x++)
if (is_vassal_mustered_with(x, lord))
++n
return n
@@ -4590,7 +4590,7 @@ function can_tax_at(here) {
return true
// vassal seats
- for (let vassal = first_vassal; vassal < last_vassal; ++vassal)
+ for (let vassal = first_vassal; vassal <= last_vassal; ++vassal)
if (is_vassal_mustered_with(vassal, game.command))
if (here === data.vassals[vassal].seat)
return true
@@ -6745,7 +6745,7 @@ function goto_pay_vassals() {
clear_undo()
let vassal_to_pay = false
- for (let v = first_vassal; v < last_vassal; v++) {
+ for (let v = first_vassal; v <= last_vassal; v++) {
if (
is_vassal_mustered_with_friendly_lord(v) &&
get_vassal_service(v) === current_turn()
@@ -6777,7 +6777,7 @@ states.pay_vassals = {
let done = true
view.prompt = "You may pay or disband vassals in the next calendar box."
if (game.what === NOBODY) {
- for (let v = first_vassal; v < last_vassal; v++) {
+ for (let v = first_vassal; v <= last_vassal; v++) {
if (
is_vassal_mustered_with_friendly_lord(v) &&
get_vassal_service(v) === current_turn()