Sdk/World: Fix block pointers

This commit is contained in:
Lynix 2017-04-21 01:02:23 +02:00
parent 48b348135e
commit 53b92106ff
1 changed files with 5 additions and 1 deletions

View File

@ -73,7 +73,7 @@ namespace Ndk
else
{
// We allocate a new entity
id = static_cast<Ndk::EntityId>(m_entities.size());
id = static_cast<Ndk::EntityId>(m_entityBlocks.size());
if (m_entities.capacity() > m_entities.size())
{
@ -205,6 +205,10 @@ namespace Ndk
m_entities.push_back(std::move(*blockPtr));
m_waitingEntities.clear();
// Update entity blocks pointers
for (std::size_t i = 0; i < m_entities.size(); ++i)
m_entityBlocks[i] = &m_entities[i];
}
// Handle killed entities before last call