tweak max-wheelbarrow: fix conflict with building renaming

Reported by xordae on bay12:
http://www.bay12forums.com/smf/index.php?topic=164123.msg7762438#msg7762438
develop
lethosor 2018-05-16 16:51:45 -04:00
parent 0be16d4422
commit c85274eb01
2 changed files with 5 additions and 3 deletions

@ -40,6 +40,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## New Tweaks
- `tweak` stone-status-all: adds an option to toggle the economic status of all stones
## Fixes
- `tweak` max-wheelbarrow: fixed conflict with building renaming
## Misc Improvements
- `gui/room-list`: added support for ``Gui::getSelectedBuilding()``
- `search`: added support for stone restrictions screen (under ``z``: Status)

@ -43,7 +43,7 @@ struct max_wheelbarrow_hook : df::viewscreen_dwarfmodest {
{
df::building_stockpilest* stockpile = getStockpile();
bool handled = false;
if (stockpile)
if (stockpile && !Gui::inRenameBuilding())
{
handled = true;
if (!in_wheelbarrow_entry &&
@ -72,9 +72,8 @@ struct max_wheelbarrow_hook : df::viewscreen_dwarfmodest {
}
else
{
for (auto iter = input->begin(); iter != input->end(); ++iter)
for (df::interface_key key : *input)
{
df::interface_key key = *iter;
if (key >= Screen::charToKey('0') && key <= Screen::charToKey('9') &&
wheelbarrow_entry.size() < 3)
{