-fixed crash on getComponent when component doesn't exist
-fixed Components ids sorting -added deferred object removing -new EntityManager functions: begin(), end().
This commit is contained in:
parent
a066a97f01
commit
8fdb56e840
3 changed files with 43 additions and 18 deletions
|
|
@ -21,6 +21,7 @@ struct Entity
|
|||
{
|
||||
EntityManager.EntitiesBlock* block = gEM.getMetaData(&this);
|
||||
EntityManager.EntityInfo* info = block.type_data;
|
||||
if(T.component_id >= info.deltas.length || info.deltas[T.component_id] == 0)return null;
|
||||
return cast(T*)(cast(void*)&this + info.deltas[T.component_id]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue