Skip to content

Commit

Permalink
fix(ecs): fix off by one on ComponentManager
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Nov 1, 2023
1 parent f97c773 commit ff92b96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/cubos/core/ecs/component/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<IStorage> storage)
Expand Down

0 comments on commit ff92b96

Please sign in to comment.