Split identifier and legacyIdentifier on Object

This commit is contained in:
Ted John committed 2020-05-08 15:28:48 +01:00
1 parent 3417c10a61
commit 46d69126ea
17 files changed
+121 -104

No files matched your search

+3 -5
View File
@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright (c) 2014-2019 OpenRCT2 developers
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
@@ -252,12 +252,10 @@ public:
return _items.data();
}
const ObjectRepositoryItem* FindObject(const utf8* name) const override
const ObjectRepositoryItem* FindObject(const std::string_view& legacyIdentifier) const override
{
rct_object_entry entry = {};
utf8 entryName[9] = { ' ' };
String::Set(entryName, sizeof(entryName), name);
std::copy_n(entryName, 8, entry.name);
entry.SetName(legacyIdentifier);
auto kvp = _itemMap.find(entry);
if (kvp != _itemMap.end())