From 68f1e65cbde8829ec23133b0d9b7a232d619966d Mon Sep 17 00:00:00 2001 From: "zer0.k" <61156310+zer0k-z@users.noreply.github.com> Date: Sun, 4 Feb 2024 07:19:45 +0100 Subject: [PATCH] Expand EntityInstanceByClassIter_t (#199) --- entity2/entitysystem.cpp | 9 +++++++++ public/entity2/entitysystem.h | 1 + 2 files changed, 10 insertions(+) diff --git a/entity2/entitysystem.cpp b/entity2/entitysystem.cpp index efd3996f..06a9e38b 100644 --- a/entity2/entitysystem.cpp +++ b/entity2/entitysystem.cpp @@ -313,6 +313,15 @@ EntityInstanceByClassIter_t::EntityInstanceByClassIter_t(const char* szClassName } } +EntityInstanceByClassIter_t::EntityInstanceByClassIter_t(CEntityInstance* pStart, char const* szClassName, IEntityFindFilter* pFilter = nullptr, EntityIterType_t eIterType = ENTITY_ITER_OVER_ACTIVE) +{ + m_pCurrentEnt = pStart ? pStart->m_pEntity : nullptr; + m_pFilter = pFilter; + m_eIterType = eIterType; + m_pszClassName = szClassName; + m_pEntityClass = NULL; +} + CEntityInstance* EntityInstanceByClassIter_t::First() { m_pCurrentEnt = nullptr; diff --git a/public/entity2/entitysystem.h b/public/entity2/entitysystem.h index 68d65e29..5aeb9567 100644 --- a/public/entity2/entitysystem.h +++ b/public/entity2/entitysystem.h @@ -408,6 +408,7 @@ class EntityInstanceByClassIter_t { public: EntityInstanceByClassIter_t(const char* szClassName, IEntityFindFilter* pFilter = nullptr, EntityIterType_t eIterType = ENTITY_ITER_OVER_ACTIVE); + EntityInstanceByClassIter_t(CEntityInstance* pStart, char const* szClassName, IEntityFindFilter* pFilter = nullptr, EntityIterType_t eIterType = ENTITY_ITER_OVER_ACTIVE); CEntityInstance* First(); CEntityInstance* Next();