From de07c6526e267273b95d373c7340bbd76a31c2a7 Mon Sep 17 00:00:00 2001 From: Sean Chapel Date: Fri, 28 Aug 2015 10:27:29 -0700 Subject: [PATCH] Fixed issue with entities refreshing not working properly if you add to the refresh list while the entity world is currently refreshing. Note that the foreach loop will actually still throw an exception. --- Artemis_XNA_INDEPENDENT/EntityWorld.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Artemis_XNA_INDEPENDENT/EntityWorld.cs b/Artemis_XNA_INDEPENDENT/EntityWorld.cs index c79dca3..443c0b7 100644 --- a/Artemis_XNA_INDEPENDENT/EntityWorld.cs +++ b/Artemis_XNA_INDEPENDENT/EntityWorld.cs @@ -386,6 +386,7 @@ public void Update(long deltaTicks) Entity entity = this.refreshed.Get(index); this.EntityManager.Refresh(entity); entity.RefreshingState = false; + this.refreshed.Remove(index); } #else foreach (Entity entity in this.refreshed) @@ -394,8 +395,8 @@ public void Update(long deltaTicks) entity.RefreshingState = false; } -#endif this.refreshed.Clear(); +#endif } this.SystemManager.Update();