Custom GameLogic SetContainer called twice

Equinox shared this bug 11 months ago
Considered

When there is only one custom game logic component attached to an entity SetContainer will be called twice, resulting in two calls to OnAddedToContainer.

        public static MyGameLogicComponent Create(ICollection<MyGameLogicComponent> logicComponents, MyEntity entity)
        {
            foreach (MyGameLogicComponent myGameLogicComponent in logicComponents)
            {
                myGameLogicComponent.SetContainer(entity.Components); // first call here
            }
            switch (logicComponents.Count)
            {
            case 0:
                return null;
            case 1:
                return logicComponents.First<MyGameLogicComponent>(); // second call when the returned component gets added
            default:
                return new MyCompositeGameLogicComponent(logicComponents);
            }
        }

Comments (1)

photo
1

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards

Keen Software House: QA Department