-fixed optional components issue
This commit is contained in:
parent
c0ac19b6f9
commit
41a7f22cb3
1 changed files with 3 additions and 3 deletions
|
|
@ -150,8 +150,8 @@ class EntityManager
|
|||
if (isPointer!param)
|
||||
{
|
||||
ret ~= "PointerTarget!(types[" ~ i.to!string
|
||||
~ "])[] opt_array" ~ opt.to!string ~ ";";
|
||||
ret ~= "if(info.deltas[types[" ~ i.to!string ~ "].component_id] != ushort.max)opt_array"
|
||||
~ "])[] opt_array" ~ opt.to!string ~ " = null;";
|
||||
ret ~= "if(info.deltas[types[" ~ i.to!string ~ "].component_id] != 0)opt_array"
|
||||
~ opt.to!string ~ "
|
||||
= (cast(types[" ~ i.to!string ~ "])(cast(void*)block + info.deltas[types["
|
||||
~ i.to!string ~ "].component_id]))[0..block.entities_count];";
|
||||
|
|
@ -266,7 +266,7 @@ class EntityManager
|
|||
foreach (i, ref pointer; optional_pointers)
|
||||
{
|
||||
uint ind = cast(uint)(i + pointers.length);
|
||||
if (data.deltas[ind] != uint.max)
|
||||
if (data.deltas[ind] != 0)
|
||||
pointer = data_pointer + data.deltas[ind];
|
||||
else
|
||||
pointer = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue