fix issue with reading pending component
parent
df27c78e02
commit
1ce6e0e907
|
@ -222,9 +222,20 @@ namespace Encompass
|
||||||
var pendingRead = receiveTypes.Contains(typeof(PendingComponentMessage<TComponent>));
|
var pendingRead = receiveTypes.Contains(typeof(PendingComponentMessage<TComponent>));
|
||||||
var existingRead = receiveTypes.Contains(typeof(ComponentMessage<TComponent>));
|
var existingRead = receiveTypes.Contains(typeof(ComponentMessage<TComponent>));
|
||||||
if (existingRead && pendingRead)
|
if (existingRead && pendingRead)
|
||||||
|
{
|
||||||
|
if (componentMessageManager.HasPendingComponent<TComponent>(entity))
|
||||||
{
|
{
|
||||||
return componentMessageManager.ReadPendingComponentByEntityAndType<TComponent>(entity);
|
return componentMessageManager.ReadPendingComponentByEntityAndType<TComponent>(entity);
|
||||||
}
|
}
|
||||||
|
else if (componentMessageManager.HasExistingComponent<TComponent>(entity))
|
||||||
|
{
|
||||||
|
return componentMessageManager.ReadExistingComponentByEntityAndType<TComponent>(entity);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new NoComponentOfTypeOnEntityException("No Component of type {0} exists on Entity {1}", typeof(TComponent).Name, entity.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (existingRead)
|
else if (existingRead)
|
||||||
{
|
{
|
||||||
return componentMessageManager.ReadExistingComponentByEntityAndType<TComponent>(entity);
|
return componentMessageManager.ReadExistingComponentByEntityAndType<TComponent>(entity);
|
||||||
|
|
Loading…
Reference in New Issue