Merge remote-tracking branch 'Nilsolm/fix/buildingplan-handleinput' into develop

develop
lethosor 2020-11-17 23:22:18 -05:00
commit 2d79052938
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
2 changed files with 2 additions and 1 deletions

@ -37,6 +37,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- Fixed an issue on some Linux systems where DFHack installed through a package manager would attempt to write files to a non-writable folder (notably when running `exportlegends` or `gui/autogems`)
- `buildingplan`: artifacts are now successfully matched when max quality is set to ``artifacts``
- `buildingplan`: no longer erroneously matches items to buildings while the game is paused
- `buildingplan`: fixed a crash when pressing 0 while having a noble room selected
- `dwarfmonitor`: fixed a crash when opening the ``prefs`` screen if units have vague preferences
- `embark-assistant`: fixed an issue causing incursion resource matching (e.g. sand/clay) to skip some tiles if those resources were provided only through incursions
- `zone`: fixed an issue causing the ``enumnick`` subcommand to run when attempting to run ``assign``, ``unassign``, or ``slaughter``

@ -864,7 +864,7 @@ struct buildingplan_room_hook : public df::viewscreen_dwarfmodest
&& last_token <= interface_key::STRING_A058)
{
size_t selection = last_token - interface_key::STRING_A048;
if (np.size() < selection)
if (np.size() < selection || selection == 0)
return false;
roomMonitor.toggleRoomForPosition(world->selected_building->id, np.at(selection-1).position->code);
return true;