Moved Entity <=> operator for now since it was breaking list remove

This commit is contained in:
Matt Thorson 2020-05-30 17:00:05 -07:00
parent 9bb6ac6a73
commit 228295649e
2 changed files with 7 additions and 2 deletions

View File

@ -425,5 +425,10 @@ namespace Strawberry
{
Draw.Rect(SceneHitbox, color);
}
static public int Compare(Entity a, Entity b)
{
return a.Depth <=> b.Depth;
}
}
}

View File

@ -97,8 +97,6 @@ namespace Strawberry
{
for (let e in toRemove)
{
Calc.Log(scope => e.GetType().GetName);
entities.Remove(e);
UntrackEntity(e);
e.[Friend]Removed();
@ -117,6 +115,8 @@ namespace Strawberry
TrackEntity(e);
e.[Friend]Added(this);
}
entities.Sort(scope => Entity.Compare);
}
for (let e in entities)