AssetID check for 0
This commit is contained in:
parent
ae024e9757
commit
c3d027f5b1
|
@ -6,6 +6,11 @@ namespace SHADE
|
||||||
template<typename T>
|
template<typename T>
|
||||||
std::enable_if_t<std::is_base_of_v<SHAssetData, T>, T* const> SHAssetManager::GetData(AssetID id) noexcept
|
std::enable_if_t<std::is_base_of_v<SHAssetData, T>, T* const> SHAssetManager::GetData(AssetID id) noexcept
|
||||||
{
|
{
|
||||||
|
if (id == 0)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!assetData.contains(id))
|
if (!assetData.contains(id))
|
||||||
{
|
{
|
||||||
for (auto const& asset : std::ranges::views::values(assetCollection))
|
for (auto const& asset : std::ranges::views::values(assetCollection))
|
||||||
|
|
Loading…
Reference in New Issue