Fix use of HasBit beyond field width in ShowDropDownMenu masks

This commit is contained in:
Jonathan G Rennison
2018-06-06 19:24:17 +01:00
parent b5dea7f236
commit 8f25bbc93c

View File

@@ -485,8 +485,8 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
DropDownList *list = new DropDownList();
for (uint i = 0; strings[i] != INVALID_STRING_ID; i++) {
if (!HasBit(hidden_mask, i)) {
*list->Append() = new DropDownListStringItem(strings[i], i, HasBit(disabled_mask, i));
if (i >= 32 || !HasBit(hidden_mask, i)) {
*list->Append() = new DropDownListStringItem(strings[i], i, i < 32 && HasBit(disabled_mask, i));
}
}