Browse Source

Fix bug

tags/2.6a
sebas77 6 years ago
parent
commit
d2f2c76ca2
3 changed files with 5 additions and 9 deletions
  1. +1
    -1
      Svelto.Common
  2. +0
    -1
      Svelto.ECS/EnginesRoot.Entities.cs
  3. +4
    -7
      Svelto.ECS/EnginesRoot.Submission.cs

+ 1
- 1
Svelto.Common

@@ -1 +1 @@
Subproject commit 70c3fa30662f89cd1b023802f114dd917e156d2e
Subproject commit 554875838f1743017981df428243bba80fe3ece1

+ 0
- 1
Svelto.ECS/EnginesRoot.Entities.cs View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Svelto.DataStructures.Experimental;
using Svelto.ECS.Internal;



+ 4
- 7
Svelto.ECS/EnginesRoot.Submission.cs View File

@@ -19,16 +19,14 @@ namespace Svelto.ECS
//are there new entities built to process?
while ( _newEntitiesBuiltToProcess > 0)
{
_newEntitiesBuiltToProcess = 0;
//use other as source from now on
//current will be use to write new entityViews
_groupedEntityToAdd.Swap();

//Note: if N entity of the same type are added on the same frame
//the Add callback is called N times on the same frame.
//if the Add calback builds a new entity, that entity will not
//be available in the database until the N callbacks are done
//solving it could be complicated as callback and database update
//must be interleaved.
//Note: if N entity of the same type are added on the same frame the Add callback is called N times on
//the same frame. if the Add calback builds a new entity, that entity will not be available in the
//database until the N callbacks are done.
if (_groupedEntityToAdd.other.Count > 0)
AddEntityViewsToTheDBAndSuitableEngines(_groupedEntityToAdd.other);

@@ -38,7 +36,6 @@ namespace Svelto.ECS
if (numberOfReenteringLoops > 5)
throw new Exception("possible infinite loop found creating Entities inside IEntityViewsEngine Add method, please consider building entities outside IEntityViewsEngine Add method");

_newEntitiesBuiltToProcess = 0;
numberOfReenteringLoops++;
}
}


Loading…
Cancel
Save