Merge pull request #1487 from DarkflameUniverse/voidptr

fix: remove void*
This commit is contained in:
Gie "Max" Vanommeslaeghe 2024-03-02 09:26:31 +01:00 committed by GitHub
commit 7d626dc31b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -841,11 +841,9 @@ bool Entity::HasComponent(const eReplicaComponentType componentId) const {
std::vector<ScriptComponent*> Entity::GetScriptComponents() {
std::vector<ScriptComponent*> comps;
for (std::pair<eReplicaComponentType, void*> p : m_Components) {
if (p.first == eReplicaComponentType::SCRIPT) {
comps.push_back(static_cast<ScriptComponent*>(p.second));
}
}
auto* scriptComponent = GetComponent<ScriptComponent>();
if (scriptComponent) comps.push_back(scriptComponent);
return comps;
}