diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 75a671cc83..e51cec70ff 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -5,6 +5,7 @@ - Change: [#24730] Security guards now only walk slowly in crowded areas. - Fix: [#24598] Cannot load .park files that use official legacy footpaths by accident. - Fix: [#24773] The new ride window debug authors does not show the correct authors for non legacy ride objects. +- Fix: [#24775] The scenery and new ride windows do not filter by file name or identifier correctly for non legacy objects. 0.4.24 (2025-07-05) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 7e48b97303..8c83da25aa 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -786,15 +786,12 @@ namespace OpenRCT2::Ui::Windows bool IsFilterInIdentifier(const RideObject& rideObject) { - auto objectName = rideObject.GetObjectEntry().GetName(); - - return String::contains(objectName, _filter, true); + return String::contains(rideObject.GetIdentifier(), _filter, true); } bool IsFilterInFilename(const RideObject& rideObject) { - auto repoItem = ObjectRepositoryFindObjectByEntry(&(rideObject.GetObjectEntry())); - + const auto* const repoItem = OpenRCT2::GetContext()->GetObjectRepository().FindObject(rideObject.GetIdentifier()); return String::contains(repoItem->Path, _filter, true); } diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 34908386fb..3096d8b8e2 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -1366,7 +1366,7 @@ namespace OpenRCT2::Ui::Windows bool IsFilterInFilename(const Object& object) { - auto repoItem = ObjectRepositoryFindObjectByEntry(&(object.GetObjectEntry())); + const auto* const repoItem = OpenRCT2::GetContext()->GetObjectRepository().FindObject(object.GetIdentifier()); return String::contains(repoItem->Path, _filteredSceneryTab.Filter, true); }