From ff92b960fa98770cecbe5f3fa5cdde86deaf9b72 Mon Sep 17 00:00:00 2001 From: Ricardo Antunes Date: Mon, 23 Oct 2023 16:36:55 +0100 Subject: [PATCH] fix(ecs): fix off by one on ComponentManager --- core/src/cubos/core/ecs/component/manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/cubos/core/ecs/component/manager.cpp b/core/src/cubos/core/ecs/component/manager.cpp index 3871c976c..55ca5b548 100644 --- a/core/src/cubos/core/ecs/component/manager.cpp +++ b/core/src/cubos/core/ecs/component/manager.cpp @@ -64,12 +64,12 @@ void ComponentManager::removeAll(uint32_t id) IStorage* ComponentManager::storage(std::size_t id) { - return mEntries.at(id).storage.get(); + return mEntries.at(id - 1).storage.get(); } const IStorage* ComponentManager::storage(std::size_t id) const { - return mEntries.at(id).storage.get(); + return mEntries.at(id - 1).storage.get(); } ComponentManager::Entry::Entry(std::unique_ptr storage)