diff --git a/plugins/autohauler.cpp b/plugins/autohauler.cpp index e222a9702..c43ec110e 100644 --- a/plugins/autohauler.cpp +++ b/plugins/autohauler.cpp @@ -624,7 +624,7 @@ static void init_state() df::unit_labor labor = (df::unit_labor) atoi(key.substr(strlen("autohauler/labors/")).c_str()); // Ensure that the labor is defined in the existing list - if (labor >= 0 && size_t(labor) <= labor_infos.size()) + if (labor >= 0 && size_t(labor) < labor_infos.size()) { // Link the labor treatment with the associated persistent data item labor_infos[labor].set_config(*p); diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp index 6ca0a2658..936ce4022 100644 --- a/plugins/autolabor.cpp +++ b/plugins/autolabor.cpp @@ -606,7 +606,7 @@ static void init_state() { string key = p->key(); df::unit_labor labor = (df::unit_labor) atoi(key.substr(strlen("autolabor/labors/")).c_str()); - if (labor >= 0 && size_t(labor) <= labor_infos.size()) + if (labor >= 0 && size_t(labor) < labor_infos.size()) { labor_infos[labor].config = *p; labor_infos[labor].is_exclusive = default_labor_infos[labor].is_exclusive; diff --git a/plugins/labormanager/labormanager.cpp b/plugins/labormanager/labormanager.cpp index cf183f452..7c749edce 100644 --- a/plugins/labormanager/labormanager.cpp +++ b/plugins/labormanager/labormanager.cpp @@ -614,7 +614,7 @@ static void init_state() { string key = p->key(); df::unit_labor labor = (df::unit_labor) atoi(key.substr(strlen("labormanager/2.0/labors/")).c_str()); - if (labor >= 0 && size_t(labor) <= labor_infos.size()) + if (labor >= 0 && size_t(labor) < labor_infos.size()) { labor_infos[labor].config = *p; labor_infos[labor].active_dwarfs = 0;