Prevented crash on isValid on entity entity

This commit is contained in:
Antoine Pilote
2024-09-05 21:49:11 -04:00
parent 5034adca8e
commit 8d69094cf2
2 changed files with 1 additions and 2 deletions

View File

@@ -276,7 +276,6 @@ std::string FileSystem::GetFileNameFromPath(const std::string& path)
return String::Split(split[split.size() - 1], '.')[0];
}
Directory::Directory(const std::string& path)
{
Files = std::vector<Ref<File>>();

View File

@@ -28,7 +28,7 @@ namespace Nuake
bool IsValid() const
{
return m_Scene->m_Registry.valid((entt::entity)GetHandle());
return m_EntityHandle != (entt::entity)-1 && m_Scene->m_Registry.valid((entt::entity)GetHandle());
}
template<typename T>