Skip to content

Commit 1896055

Browse files
authored
Merge pull request #5561 from ab9rf/stockpile-export
fix off-by-one in furniture stockpile export
2 parents ee34213 + 078741e commit 1896055

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Template for new versions:
5959

6060
## Fixes
6161
- ``Units::getReadableName`` will no longer append a comma to the names of histfigs with no profession
62+
- `stockpiles`: fixed off-by-one error in exporting furniture stockpiles
6263

6364
## Misc Improvements
6465

plugins/stockpiles/StockpileSerializer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,6 @@ static bool furniture_mat_is_allowed(const MaterialInfo& mi) {
17311731

17321732
bool StockpileSettingsSerializer::write_furniture(color_ostream& out, StockpileSettings::FurnitureSet* furniture) {
17331733
using df::enums::furniture_type::furniture_type;
1734-
using type_traits = df::enum_traits<furniture_type>;
17351734

17361735
auto & pfurniture = mSettings->furniture;
17371736
bool all = true;
@@ -1741,7 +1740,7 @@ bool StockpileSettingsSerializer::write_furniture(color_ostream& out, StockpileS
17411740
all = false;
17421741
continue;
17431742
}
1744-
string f_type(type_traits::key_table[i]);
1743+
string f_type{ENUM_KEY_STR(furniture_type, furniture_type(i))};
17451744
furniture->add_type(f_type);
17461745
DEBUG(log, out).print("furniture_type %zd is %s\n", i, f_type.c_str());
17471746
}

0 commit comments

Comments
 (0)