From fa3374c827fd8a2e5390fd1ebafab8f9666c39b1 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 22 Dec 2018 11:18:17 +0000 Subject: [PATCH] Fix #8484: Object selection doesn't work Revert change to _filter_object_counts from d145ae69224282536bf63b31d0b0821b580bde82 --- src/openrct2-ui/windows/EditorObjectSelection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 86597d018a..b49959e4cd 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -63,6 +63,7 @@ enum static constexpr uint8_t _numSourceGameItems = 8; static uint32_t _filter_flags; +static uint16_t _filter_object_counts[OBJECT_TYPE_COUNT]; static char _filter_string[MAX_PATH]; @@ -107,8 +108,6 @@ static constexpr const ObjectPageDesc ObjectSelectionPages[] = { // { STR_OBJECT_SELECTION_MUSIC, SPR_TAB_MUSIC_0, false }, }; -static uint16_t _filter_object_counts[std::size(ObjectSelectionPages)]; - #pragma region Widgets enum WINDOW_STAFF_LIST_WIDGET_IDX { @@ -1473,10 +1472,7 @@ static void filter_update_counts() if (!_FILTER_ALL || strlen(_filter_string) > 0) { const auto& selectionFlags = _objectSelectionFlags; - for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) - { - _filter_object_counts[i] = 0; - } + std::fill(std::begin(_filter_object_counts), std::end(_filter_object_counts), 0); size_t numObjects = object_repository_get_items_count(); const ObjectRepositoryItem* items = object_repository_get_items();