summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js8
-rw-r--r--rules.js12
2 files changed, 10 insertions, 10 deletions
diff --git a/play.js b/play.js
index 0bce29a..5eba9f0 100644
--- a/play.js
+++ b/play.js
@@ -410,7 +410,7 @@ function count_lord_all_forces(lord) {
function count_favour(type) {
let n = 0
- for (let x = first_locale; x < last_locale; x++) {
+ for (let x = first_locale; x <= last_locale; x++) {
if (data.locales[x].type !== type)
continue
if (set_has(view.pieces.favourl, x))
@@ -430,7 +430,7 @@ function get_vassal_service(vassal) {
}
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 (get_vassal_lord(x) === lord)
f(x)
}
@@ -1375,7 +1375,7 @@ function update_plan() {
}
function update_cards() {
- for (let c = 0; c < last_aow_card; ++c) {
+ for (let c = 0; c <= last_aow_card; ++c) {
let elt = ui.cards[c]
elt.classList.toggle("selected", c === view.what)
elt.classList.toggle("action", is_action("card", c))
@@ -1464,7 +1464,7 @@ function update_court() {
}
function update_vassals() {
- for (let v = first_vassal; v < last_vassal; v++) {
+ for (let v = first_vassal; v <= last_vassal; v++) {
let loc = get_vassal_lord(v)
let srv = get_vassal_service(v)
if (loc === VASSAL_OUT_OF_PLAY) {
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()