fix false positive on filter remove callback
parent
1438188dca
commit
4ff546538b
|
@ -118,10 +118,12 @@ namespace MoonTools.ECS
|
||||||
{
|
{
|
||||||
if (!EntityStorage.HasComponent(entityID, type))
|
if (!EntityStorage.HasComponent(entityID, type))
|
||||||
{
|
{
|
||||||
filterSignatureToEntityIDs[filterSignature].Remove(entityID);
|
if (filterSignatureToEntityIDs[filterSignature].Remove(entityID))
|
||||||
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
|
||||||
{
|
{
|
||||||
removeCallback(entityID);
|
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
||||||
|
{
|
||||||
|
removeCallback(entityID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -131,10 +133,12 @@ namespace MoonTools.ECS
|
||||||
{
|
{
|
||||||
if (EntityStorage.HasComponent(entityID, type))
|
if (EntityStorage.HasComponent(entityID, type))
|
||||||
{
|
{
|
||||||
filterSignatureToEntityIDs[filterSignature].Remove(entityID);
|
if (filterSignatureToEntityIDs[filterSignature].Remove(entityID))
|
||||||
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
|
||||||
{
|
{
|
||||||
removeCallback(entityID);
|
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
||||||
|
{
|
||||||
|
removeCallback(entityID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -153,10 +157,12 @@ namespace MoonTools.ECS
|
||||||
{
|
{
|
||||||
foreach (var filterSignature in filterSignatures)
|
foreach (var filterSignature in filterSignatures)
|
||||||
{
|
{
|
||||||
filterSignatureToEntityIDs[filterSignature].Remove(entityID);
|
if (filterSignatureToEntityIDs[filterSignature].Remove(entityID))
|
||||||
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
|
||||||
{
|
{
|
||||||
removeCallback(entityID);
|
if (removeCallbacks.TryGetValue(filterSignature, out var removeCallback))
|
||||||
|
{
|
||||||
|
removeCallback(entityID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue