From 6df6e3e31375a2c3bfbb18f5687120d66c2cefbc Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sat, 2 Mar 2024 00:25:16 -0800 Subject: [PATCH] remove void* --- dGame/Entity.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 2611f1dd..9af811bc 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -841,11 +841,9 @@ bool Entity::HasComponent(const eReplicaComponentType componentId) const { std::vector Entity::GetScriptComponents() { std::vector comps; - for (std::pair p : m_Components) { - if (p.first == eReplicaComponentType::SCRIPT) { - comps.push_back(static_cast(p.second)); - } - } + + auto* scriptComponent = GetComponent(); + if (scriptComponent) comps.push_back(scriptComponent); return comps; }