mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-09-06 00:37:26 +00:00
fix: messed up kvp compiler reference
This commit is contained in:
@@ -52,14 +52,15 @@ public:
|
||||
static_assert(std::is_base_of_v<IZoneAssetCreationState, T>, "T must inherit IZoneAssetCreationState");
|
||||
// T must also have a public default constructor
|
||||
|
||||
const auto foundEntry = m_zone_asset_creation_states.find(typeid(T));
|
||||
std::type_index typeId = typeid(T);
|
||||
const auto foundEntry = m_zone_asset_creation_states.find(typeId);
|
||||
if (foundEntry != m_zone_asset_creation_states.end())
|
||||
return *dynamic_cast<T*>(foundEntry->second.get());
|
||||
|
||||
auto newState = std::make_unique<T>();
|
||||
newState->Inject(m_injection);
|
||||
auto* newStatePtr = newState.get();
|
||||
m_zone_asset_creation_states.emplace(std::make_pair<std::type_index, std::unique_ptr<IZoneAssetCreationState>>(typeid(T), std::move(newState)));
|
||||
m_zone_asset_creation_states.emplace(std::move(typeId), std::move(newState));
|
||||
|
||||
return *newStatePtr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user