ignore input if selection is zero

develop
Nilsolm 2020-11-18 02:41:20 +01:00
parent 0f849cf278
commit 4ac3e62e60
1 changed files with 1 additions and 1 deletions

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