-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)
|
if (isPointer!param)
|
||||||
{
|
{
|
||||||
ret ~= "PointerTarget!(types[" ~ i.to!string
|
ret ~= "PointerTarget!(types[" ~ i.to!string
|
||||||
~ "])[] opt_array" ~ opt.to!string ~ ";";
|
~ "])[] opt_array" ~ opt.to!string ~ " = null;";
|
||||||
ret ~= "if(info.deltas[types[" ~ i.to!string ~ "].component_id] != ushort.max)opt_array"
|
ret ~= "if(info.deltas[types[" ~ i.to!string ~ "].component_id] != 0)opt_array"
|
||||||
~ opt.to!string ~ "
|
~ opt.to!string ~ "
|
||||||
= (cast(types[" ~ i.to!string ~ "])(cast(void*)block + info.deltas[types["
|
= (cast(types[" ~ i.to!string ~ "])(cast(void*)block + info.deltas[types["
|
||||||
~ i.to!string ~ "].component_id]))[0..block.entities_count];";
|
~ i.to!string ~ "].component_id]))[0..block.entities_count];";
|
||||||
|
|
@ -266,7 +266,7 @@ class EntityManager
|
||||||
foreach (i, ref pointer; optional_pointers)
|
foreach (i, ref pointer; optional_pointers)
|
||||||
{
|
{
|
||||||
uint ind = cast(uint)(i + pointers.length);
|
uint ind = cast(uint)(i + pointers.length);
|
||||||
if (data.deltas[ind] != uint.max)
|
if (data.deltas[ind] != 0)
|
||||||
pointer = data_pointer + data.deltas[ind];
|
pointer = data_pointer + data.deltas[ind];
|
||||||
else
|
else
|
||||||
pointer = null;
|
pointer = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue