mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Check validity of dropdown indices (#6087)
Happens e.g. in server list browser
This commit is contained in:
committed by
Ted John
parent
0fe60663bf
commit
1fed4f0b2d
@@ -60,21 +60,37 @@ sint32 gDropdownDefaultIndex;
|
||||
|
||||
bool dropdown_is_checked(sint32 index)
|
||||
{
|
||||
if (index < 0 || index >= countof(_dropdownItemsDisabled))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return _dropdownItemsChecked[index];
|
||||
}
|
||||
|
||||
bool dropdown_is_disabled(sint32 index)
|
||||
{
|
||||
if (index < 0 || index >= countof(_dropdownItemsDisabled))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return _dropdownItemsDisabled[index];
|
||||
}
|
||||
|
||||
void dropdown_set_checked(sint32 index, bool value)
|
||||
{
|
||||
if (index < 0 || index >= countof(_dropdownItemsDisabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_dropdownItemsChecked[index] = value;
|
||||
}
|
||||
|
||||
void dropdown_set_disabled(sint32 index, bool value)
|
||||
{
|
||||
if (index < 0 || index >= countof(_dropdownItemsDisabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
_dropdownItemsDisabled[index] = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user