1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Split identifier and legacyIdentifier on Object

This commit is contained in:
Ted John
2020-05-07 19:35:30 +01:00
parent 3417c10a61
commit 46d69126ea
17 changed files with 121 additions and 104 deletions

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())