-EntitesBlock freeing
-IDManager now increment counter on ID releasing (previously while creating new ID)
This commit is contained in:
parent
45110e236c
commit
8cb5d6ce62
3 changed files with 44 additions and 13 deletions
|
|
@ -11,7 +11,7 @@ struct IDManager
|
|||
m_ids_array.add(Data());
|
||||
EntityID id;
|
||||
id.id = m_next_id;
|
||||
id.counter = ++m_ids_array[m_next_id].counter;
|
||||
id.counter = /*++*/m_ids_array[m_next_id].counter;
|
||||
m_next_id = m_ids_array[m_next_id].next_id;
|
||||
if (m_next_id == uint.max)
|
||||
m_next_id = cast(uint) m_ids_array.length;
|
||||
|
|
@ -23,6 +23,7 @@ struct IDManager
|
|||
Data* data = &m_ids_array[id.id];
|
||||
if (data.counter != id.counter)
|
||||
return;
|
||||
data.counter++;
|
||||
data.next_id = m_next_id;
|
||||
data.entity = null;
|
||||
m_next_id = id.id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue