Do not show more then max_number_of_beds

This commit is contained in:
Martin Šach 2024-11-26 12:14:45 +01:00 committed by Lukas Matena
parent 372a025356
commit 67748ba395

View File

@ -133,7 +133,7 @@ void MultipleBeds::inst_map_updated()
for (const auto& [obj_id, bed_idx] : m_inst_to_bed)
max_bed_idx = std::max(max_bed_idx, bed_idx);
if (m_number_of_beds != max_bed_idx + 1) {
if (max_bed_idx < m_number_of_beds) {
m_number_of_beds = max_bed_idx + 1;
m_active_bed = m_number_of_beds - 1;
request_next_bed(false);